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

发布于 2024-09-30 12:49:29 字数 435 浏览 3 评论 0原文

之后:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

猫瑾少女 2024-10-07 12:49:29

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 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

寻找一个思念的角度 2024-10-07 12:49:29

您是否尝试过运行killall mysqld

Have you tried running killall mysqld?

北音执念 2024-10-07 12:49:29

尝试一下..

  1. 导航到问题的父目录 cd YOURPATH/usr/local/mysql
  2. rm -rf *.local.err (删除文件)
  3. touch YOURUSERNAME.local.pid (生成新的 *.local.pid 文件,抛出的错误是抱怨的)
  4. cd回您的项目并使用 mysql.server start 重新启动 mysql

Give this a try..

  1. Navigate to the problem's parent directory cd YOURPATH/usr/local/mysql
  2. rm -rf *.local.err (deletes file)
  3. touch YOURUSERNAME.local.pid (generates new *.local.pid file the error thrown was complaining about)
  4. cd back into your project and restart mysql using mysql.server start
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文