Entry
I keep getting an ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' It dissapeared from /tmp.
Dec 16th, 2000 09:12
Rodney Rhoton, Jan Huelsberg, Joker Joe,
There are two reasons why this could happen.
The one is that the mysql demon is down.
The other is that you try to use a socket that the demon is not
expecting. I had this problem using php on a Suse linux system.
If THIS is the case and you have root access to the low traffic mysql
server, shut it down, use the mysql command at the prompt and see by
the error message which socket the client normally uses. You should
edit your php.ini file. There is an entry mysql default socket that
should be changed to the new value, and you should be without any
problems.
Don't forget to restart the mysql server.
Jan.
There is another reason. This happened to me on RH7.0. The mysql-
server3.23.22-6 rpm installs in /var/lib/mysql with 'ls -l' = "drwx-----
--", meaning only root has access. Since directory permissions must
match for the PF_UNIX socket to work, you have to 'chown -R' this to
the appropriate paranoia value (e.g. "a+x,a+r")
Rodney