簡體   English   中英

brew install mysql,嘗試停止服務器時出錯

[英]brew install mysql, error when trying to stop the server

后:

brew install mysql
mysql_install_db

我試圖stop 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

mysql的安裝說明建議將/usr/local/Cellar/mysql/5.1.54/com.mysql.mysqld.plist復制到~/Library/LaunchAgents以便Mac OS X在您登錄時自動啟動mysqld。

如果您以這種方式設置mysqld,那么在Mac OS X v10.4及更高launchd中控制LaunchAgents的launchd進程將在mysqld進程被mysql.server stop命令殺死后立即自動重啟。 這可能是錯誤消息的原因,因為服務器正在自動重新啟動。

剛剛在我的Mac上測試了這個。 運行mysql.server stop命令十次,每次'launchd'在大約一秒后重新啟動msyqld進程。 六次命令以“成功”結束! 信息。 四次以“錯誤!pid文件管理器退出而不更新文件”消息結束。

更新:剛剛意識到我沒有提到如果mysqld服務器是由launchd啟動的話。

這是停止mysqld守護進程的命令。

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

你試過運行killall mysqld嗎?

試一試..

  1. 導航到問題的父目錄cd YOURPATH/usr/local/mysql
  2. rm -rf *.local.err (刪除文件)
  3. touch YOURUSERNAME.local.pid (生成新的* .local.pid文件,拋出的錯誤正在抱怨)
  4. cd回到你的項目並使用mysql.server start重新啟動mysql

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM