Can't connect to local MySQL server rhrough socket Solution
When I log on to mysql today, the error "Can't connect to localmysqlserverrhrough socket" is displayed. The problem Can be solved based on two posts.
My system is centos
First:
Cp/usr/share/doc/MySQL-server-5.5.24/my-medium.cnf/etc/my. cnf
Second:
Touch/var/lib/mysql. scok
View the database running status
/Etc/init. d/mysql status
Prompt
ERROR! MySQL is running but PID file cocould not be found
Print the MYSQL process first
Ps aux | grep mysql
Then KILL the process
Kill-9 pid1 pid2...
Start MYSQL again
/Etc/init. d/mysql start
Check the mysql running status.
/Etc/init. d/mysql status
Because I cannot find my in/etc at the beginning. cnf this file,/usr/share/doc/MySQL-server-5.5.24/There Is A my-default.cnf under this file, looked at, feeling and my-medium.cnf almost, copy to the etc directory, to act as my. cnf,
Mysql can be started in either of the following ways: tcp or socket. Generally, it is okay to start tcp. This problem occurs only when the socket is started.