Web Hosting Talk







View Full Version : ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.


atul
05-10-2004, 06:53 AM
Hello all,
I am having problem in connecting mysql database :
When I typed mysql -u root at shell prompt: I got the error..
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
I ahve checked for file mysql.sock in mysql directory ..it isn't there..
I have changed permissions of folder mysql to 777..
changed owner and grp of all files under mysql folder to mysql...
I even tried mysqld_safe but didn't work at all...
Below I am pasting my /etc/my.cnf file for checking...
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

Can anybody help me out?

dynamicnet
05-10-2004, 09:15 AM
Greetings:

I am not sure if this will work now given the modifications you did already.

But have you tried simply stopping and restaring the mysql service?

Thank you.

atul
05-10-2004, 10:02 AM
yes dynamicnet
i tried it.
Strange thing is that there is no restart in /etc/init.d/mysql .
Ok there is something I didn't tell you about..
yesterday only I uograded cpanel with /scripts/upcp ..
and I think since then I got this error..I am very sure but I think it could be because of that or else ?
when I typed /etc/init.d/mysql stop i got this on my screen..
safe_mysqld mysqld mysqld_safe mysql
And then i typed /etc/init.d/mysql start
nothing happened at all..
I know musqld isn't running..
But I am able to trace error..
Please help dynamicnet
thank you

dynamicnet
05-10-2004, 10:04 AM
Greetings:

The forums are limited in terms of how much help can be provided (of note there are several companies that can provide help that participate in WHT --- granted for a fee).

Check in the mysql source directory for a scripts or support-files area. That should have the "mysql.server" start up script.

Thank you.

atul
05-10-2004, 10:07 AM
Hello,
Should I restart server now because now eximstats also failed..
/etc/init.d/exim start
error:
exim eximCould not create INET socket: Address already in use IO::Socket::INET: Address already in use
Please help
thank you

nightwar
05-11-2004, 12:24 AM
shouldnt it be
/etc/rc.d/init.d/mysqld ?

that error usualy happens when mysqld isnt running, type
ps -aux | grep mysql

see if its running