Web Hosting Talk







View Full Version : Missing mysql.sock file


rasputinj
12-18-2004, 03:56 AM
I am having a problem after doing some upgrades and having to reboot the server, I am not getting the

cannot connect to var/lib/mysql/mysql.sock

if I look in var/lib/mysql there is no mysql, I looked also in the tmp directory also.

What is the best way to fix this? Reinstall mysql or is there an easy fix.

I am running Centos 3.3 with the lastest kernel and have upgraded also to the latest mysql.

when I try to restart mysql in whm I get no valid mysql.sock file..

rasputinj
12-18-2004, 04:20 AM
I recreated the mysql file and then made the symbolic link, I stop and started mysql and it is up and running, I had to reconfig one of my db users, because and existing one was not working, but it works now..

Konrad
12-21-2004, 02:16 AM
Hi.

Check what is inside php.ini :
mysql.default_socket = ; default socket name for local MySQL connects. If empty, uses the built-in MySQL defaults.

So with empty value above, php is using the following:
MYSQL_SOCKET /var/tmp/mysql.sock

Instead of creating the symlink (which in my case disappeared suddenly a few times , with all database-driven sites down in effect)
you can add the correct path to socket in php.ini.

In my case it helped. Had no problems since August ;)

Konrad
----------------

Sheps
12-21-2004, 02:37 AM
IIRC, MySQL creates the sock file manually when it is started if it does not exist...

assistanz247
12-21-2004, 08:08 AM
Hi There,

Do the following..

First stop the mysql service

#killall -9 mysqld
#service mysql stop

#service mysql start


In cpanel, please run the following command.

#/usr/local/cpanel/bin/sqlsocketcheck


Will do ;)