brew install mysql,尝试停止服务器时出错 [英] brew install mysql, error when trying to stop the server

查看:98
本文介绍了brew install mysql,尝试停止服务器时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

之后:

brew install mysql
mysql_install_db

,然后尝试stop MySQL服务器:

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!

信息:

$ 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

推荐答案

mysql的安装说明建议将/usr/local/Cellar/mysql/5.1.54/com.mysql.mysqld.plist复制到~/Library/LaunchAgents,以便Mac OS X在您登录时自动启动mysqld.

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.

如果以此方式设置mysqld,则控制Mac OS X v10.4及更高版本中的LaunchAgents的launchd进程将在被mysql.server stop杀死后立即自动重启mysqld进程.命令.这可能是出现错误消息的原因,因为服务器正在自动重新启动.

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.

只需在Mac上进行测试.跑10次mysql.server stop命令,每次启动"大约一秒钟后重新启动msyqld进程.六次命令以成功!"结束信息.它以"ERROR!pid文件管理器退出而不更新文件"消息结束了四次.

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.

更新:只是意识到我没有提到如果是由launchd启动的话,如何停止mysqld服务器.

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

这是停止mysqld守护程序的命令.

Here is the command to stop the mysqld daemon.

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

这篇关于brew install mysql,尝试停止服务器时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆