Page 1 of 1

Mysql Connection Problems

PostPosted: 29. July 2009 04:55
by deejay
I'm a little confused about sockets ....

When I bring up the "XAMPP for Linux" (the orange page) i get:

Access denied for user 'root'@'localhost' (using password: NO) in /opt/lampp/htdocs/xampp/cds.php on line 64

(Note: In xampp security, I did set a root password)

When I try: /opt/lampp/bin/$ mysql -s root ... I get:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)


The "/opt/lampp/etc/my.cnf" file says:

# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /opt/lampp/var/mysql/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3306
socket = /opt/lampp/var/mysql/mysql.sock
skip-locking
key_buffer = 16M

Any ideas? Please give detailed instructions ... I'm a newbie ...

Thanks

Re: Mysql Connection Problems

PostPosted: 29. July 2009 07:48
by Wiedmann
Access denied for user 'root'@'localhost' (using password: NO) in /opt/lampp/htdocs/xampp/cds.php on line 64

(Note: In xampp security, I did set a root password)

If you set a password for the MySQL "root" user, the cds demo does not work anymore.

When I try: /opt/lampp/bin/$ mysql -s root ... I get:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

It must be:
Code: Select all
/opt/lampp/bin/$ ./mysql -u root

Re: Mysql Connection Problems

PostPosted: 31. July 2009 01:27
by deejay
Thanks for the reply.

When I try
root@ubuntu1:/opt/lampp/bin# ./mysql -u root .... I still get:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Any other suggestions I could try?

Re: Mysql Connection Problems

PostPosted: 31. July 2009 09:29
by Wiedmann
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

The user "root" have a password. Thus you have to use the password parameter.