mysql.server start
报错:The server quit without updating PID file (/usr/local/var/mysql/zhangzhenxingdeMacBook-Pro.local.pid).
最后还是重新安装!!以前数据库内容丢失。
I think one can end up in this position with older versions of mysql already installed. I had the same problem and none of the above solutions worked for me. I fixed it thus:
Used brew’s remove & cleanup commands, unloaded the launchctl script, then deleted the mysql directory in /usr/local/var , deleted my existing /etc/my.cnf (leave that one up to you, should it apply) and launchctl plist
Updated the string for the plist. Note also your alternate security script directory will be based on which version of MySQL you are installing.
Step-by-step:
1 brew remove mysql 2 3 brew cleanup 4 5 launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist 6 7 rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist 8 9 sudo rm -rf /usr/local/var/mysql
I then started from scratch:
- installed mysql with
brew install mysql - ran the commands brew suggested:
1 unset TMPDIR 2 3 mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
- Start mysql with
mysql.server startcommand, to be able to log on it - Used the alternate security script:
/usr/local/Cellar/mysql/5.5.10/bin/mysql_secure_installation
- Followed the
launchctlsection from the brew package script output such as,#start launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist #stop launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
- Boom.
Hope that helps someone!
本文详细描述了一种解决MySQL启动时出现“服务器在未更新PID文件的情况下退出”错误的方法,涉及卸载并清理旧版本,删除相关配置文件及目录,重新安装MySQL并设置启动脚本。
516

被折叠的 条评论
为什么被折叠?



