Can't connect to local MySQL server through socket '/tmp/mysql.sock'

相关提示:

  1. The server quit without updating PID file
  2. Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’
  3. 在‘系统偏好设置’里无法启动MySQL

解决方法:

  1. sudo rm /usr/local/mysql

  2. sudo rm -rf /usr/local/mysql*

3 sudo rm -rf /Library/StartupItems/MySQLCOM (可选)

4 sudo rm -rf /Library/PreferencePanes/My* (可选)

5 vim /etc/hostconfig (and removed the line MYSQLCOM=-YES-) ( 可选)

6 rm -rf ~/Library/PreferencePanes/My*

7 sudo rm -rf /Library/Receipts/mysql*

8 sudo rm -rf /Library/Receipts/MySQL*

9 sudo rm -rf /var/db/receipts/com.mysql.*

再重新安装 MySQL, 顺利启动。

显示 Gitment 评论