mysql.sock 无法找到一般存在两种问题,一是mysql服务未启动,mysql.sock没有生成,二是mysql.sock的指向位置出错,在指向位置加个mysql.sock的软链接就可以解决。
我这里遇到的情况是第一种,mysql服务无法正常启动。
执行 /usr/local/mysql/bin/mysqld start 无法启动mysql 并出现如下提示
0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.6.24) starting as process 794 ...
794 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
794 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
最后通过下方的命令正常启动mysql
sudo /usr/local/mysql/support-files/mysql.server start
原文:http://www.cnblogs.com/caly/p/4904124.html