Notes from recovering mysql problem.

yoavz

Verified User
Joined
Jul 26, 2005
Messages
10
After some hours of google`ing and man reading i've found out the most stupid problem in the world.

The error was -
Error connecting to MySQL: Can't connect to local MySQL server through socket '/tmp/mysql.sock'

for some unknown reasons, under a FreeBSD jail it popped out.

I couldn't find the file using "locate" for some reason so i've did it the long way.

# cd /
# find * |grep mysql.sock

it came out with the following -
/usr/home/mysql/mysql.sock

i've realized that ln will do the trick

# cd /tmp
# ln -s /usr/home/mysql/mysql.sock mysql.sock

restarting the mysqld server
# /usr/local/etc/rc.d/mysqld start

and Wallah - it worked.

to protect the mysql.sock file from being deleted i've digged some more in the mysql manual and came up to this page -
http://dev.mysql.com/doc/refman/5.0/en/problems-with-mysql-sock.html

it's answer to it was to "sticky" the /tmp dir, simply by using the following command -
# chmod +t /tmp


good luck,
-- Yoav, HostPro.co.il
 
Back
Top