Total Pageviews

Wednesday 30 April 2014

2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock (2)

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
it is not the error bcoz when mysql deamon starts it 1st checks the /tmp/mysql.sock
if /tmp permission changes to other than 777 then the above error comes
i've faced the same error 
when i checked /var/lib/mysql/ for mysql.sock it didn't found there it never happens when it is not found but if not found then try to create uor self command is

cd /var/lib/mysql 
touch mysql.sock
chown mysql:mysql mysql.sock
chmod 1777 mysql.sock

now make a sym link into /tmp 

ln -s /var/lib/mysql/mysql.sock /tmp
then
chmod 1777 /tmp

now 
/scripts/mysqlup --force


now just restart mysql
/etc/rc.d/init.d/mysql restart

No comments:

Post a Comment