brew mysql 失败,brew install mysql,尝试停止服务器时出错

After:

brew install mysql

mysql_install_db

and I try to stop the MySQL server:

$ mysql.server stop

Shutting down MySQL

.. ERROR! Manager of pid-file quit without updating file.

How can I fix the above error? Thanks!

Info:

$ mysql -v

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.1.51 Source distribution

解决方案

The install instructions for mysql suggest copying /usr/local/Cellar/mysql/5.1.54/com.mysql.mysqld.plist to ~/Library/LaunchAgents so that Mac OS X will automatically launch mysqld when you login.

If you've set up mysqld this way then the launchd process, which controls LaunchAgents in Mac OS X v10.4 and above, will automatically restart the mysqld process as soon as it is being killed by the mysql.server stop command. This might be the reason for the error message, because the server is being automatically restarted.

Just tested this on my Mac. Ran the mysql.server stop command ten times and each time 'launchd' restarted the msyqld process after about a second. Six times the command ended with a "SUCCESS!" message. Four times it ended with the "ERROR! Manager of pid-file quit without updating file" message.

UPDATE: Just realised I didn't mention how to stop the mysqld server if it is being started by launchd.

Here is the command to stop the mysqld daemon.

launchctl unload -w ~/Library/LaunchAgents/com.mysql.mysqld.plist

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值