patternsqlMinor
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Viewed 0 times
localcanvarconnectlibsockmysqlthroughserversocket
Problem
I tried restarting the Mysql server but its not working for me. I am sure the server is running and the permissions on the folder /var/lib/mysql/ are correct (777).
When i tried to open the file mysql.sock, its giving me an error saying the file may be corrupt.
Please help me to log on to the mysql server.
When i tried to open the file mysql.sock, its giving me an error saying the file may be corrupt.
Please help me to log on to the mysql server.
Solution
First: Make sure that the owner of
to do that run the following command:
Second: change write permissions to rwxr-xr-x (755) for mysql directory, and all its files and subdirectories, by running the following command:
now start mysql service
/var/lib/mysql and its files and subdirectories is mysql user of mysql groupto 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
service mysql startCode Snippets
chown mysql:mysql -R /var/lib/mysql/*chmod 755 -R /var/lib/mysql/*service mysql startContext
StackExchange Database Administrators Q#11027, answer score: 4
Revisions (0)
No revisions yet.