The server quit without updating PID file 报错

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:

  1. installed mysql with brew install mysql
  2. 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

     

  3. Start mysql with mysql.server start command, to be able to log on it
  4. Used the alternate security script:
    /usr/local/Cellar/mysql/5.5.10/bin/mysql_secure_installation

     

  5. Followed the launchctl section 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

     

  6. Boom.

Hope that helps someone!

转载于:https://www.cnblogs.com/linuxOS/p/6815923.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值