Search This Blog

Tuesday, April 10, 2012

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)


First: Make sure that the owner of /var/lib/mysql and its files and subdirectories is mysql user of mysql group

to do that run the following command:

chown mysql.mysql -R /var/lib/mysql/*

Second: change write permissions to rwxr-xr-x (755) for mysql directory, and all its files and subdirectories, by running the following command:

chmod 755 -R /var/lib/mysql/*

now start mysql service by running the following command (Red Hat and may fedora):

service mysql start


the error message should disappear and should output:
Starting MySQL. [ OK ]

Source: http://forums.mysql.com/read.php?11,27769,213014

No comments:

Post a Comment