首先让我首先说我已经阅读并尝试了我在网上发现的所有方法和堆栈溢出。
我尝试运行时得到的结果
mysql.server start
或
sudo /usr/local/mysql/support-files/mysql.server start
是
ERROR! The server quit without updating PID file (/usr/local/var/mysql/hostname.local.pid).
我尝试跑步时得到的结果:
mysql
是
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
我也尝试过:
sudo mysqld_safe &
killall
然后尝试运行mysql sudo chmod -R 777 /usr/local/mysql/
rm /usr/local/var/mysql/localhost.err
sudo /usr/local/mysql/bin/mysqld_safe start
我没有想法,我不知道该怎么做。
答案 0 :(得分:0)
我做了什么让它真正起作用:
killall -u username
brew remove mysql
brew cleanup
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/var/mysql
sudo rm -rf /usr/local/mysql*
sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /private/var/db/receipts/*mysql*
*重新启动计算机
brew doctor and fix any errors
brew update
brew install mysql
unset TMPDIR
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
mysql.server start