I've seen a lot of questions about Mysql.sock on the internet before, and I didn't pay attention to the meaning of this thing, until my MySQL also appeared the same problem. It's a tangled one ...
Copy Code code as follows:
zhouqian@zhou:~$ MySQL
ERROR 2002 (HY000): Can ' t connect to the local MySQL server through socket '/var/run/mysqld/mysqld.sock ' (2)
Online a lot of solutions, but each person's actual situation is different, I also put all the methods above all the experiment, or can not solve, I almost reload my mysql.
Then think of a solution to the problem is how exciting things ah, on the side of the heart, the patience to continue to find. See a person in the forum mentioned MySQL error log to see, I thought of to see mysql_error.log this kind of log. All are the same mistakes: the result of their carelessness!!!!!
Copy Code code as follows:
111205 21:19:55 innodb:started; Log sequence number 0 87713
111205 21:19:55 [ERROR]/usr/sbin/mysqld:unknown variable ' replication_wild_do_table=db_test.tb1 '
111205 21:19:55 [ERROR] Aborting
111205 21:19:55 innodb:starting shutdown ...
111205 21:20:00 Innodb:shutdown completed; Log sequence number 0 87713
111205 21:20:00 [note]/usr/sbin/mysqld:shutdown complete
Results found that their own configuration file is wrong, the MySQL server is not launched, this Mysql.sock file of course can not generate. I can't find this thing ...
MySQL did not start properly until I had my profile back. Then Mysql.sock also appeared:
Copy Code code as follows:
root@zhou:/var/run/mysqld# ls
Mysqld.sock
root@zhou:/var/run/mysqld#
Take a closer look at MySQL, first master the basic purpose and then in-depth research in the source code, internal mechanisms and so on. Come on......