brew install mysql,尝试停止服务器时出错
之后:
brew install mysql
mysql_install_db
我尝试停止
MySQL 服务器:
$ mysql.server stop
Shutting down MySQL
.. ERROR! Manager of pid-file quit without updating file.
如何修复上述错误?谢谢!
信息:
$ 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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
mysql 的安装说明建议将
/usr/local/Cellar/mysql/5.1.54/com.mysql.mysqld.plist
复制到~/Library/LaunchAgents
以便 Mac当您登录时,OS X 将自动启动 mysqld。如果您以这种方式设置 mysqld,那么在 Mac OS X v10.4 及更高版本中控制 LaunchAgents 的
launchd
进程将在 mysqld 进程被 < code>mysql.server stop 命令。这可能是出现错误消息的原因,因为服务器正在自动重新启动。刚刚在我的 Mac 上测试了这个。运行 mysql.server stop 命令十次,每次“launchd”都会在大约一秒后重新启动 msyqld 进程。该命令有六次以“成功!”结束。信息。有四次以“错误!pid 文件管理器退出而不更新文件”消息结束。
更新:刚刚意识到我没有提到如何停止 mysqld 服务器(如果它是由 launchd 启动的)。
这是停止 mysqld 守护进程的命令。
launchctl unload -w ~/Library/LaunchAgents/com.mysql.mysqld.plist
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 themysql.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
您是否尝试过运行
killall mysqld
?Have you tried running
killall mysqld
?尝试一下..
cd YOURPATH/usr/local/mysql
rm -rf *.local.err
(删除文件)touch YOURUSERNAME.local.pid
(生成新的 *.local.pid 文件,抛出的错误是抱怨的)mysql.server start
重新启动 mysqlGive this a try..
cd YOURPATH/usr/local/mysql
rm -rf *.local.err
(deletes file)touch YOURUSERNAME.local.pid
(generates new *.local.pid file the error thrown was complaining about)mysql.server start