2015-04-15 65 views
0

我得到當我嘗試做一個重新開始與MySQL以下奇錯誤:mysql.server的重啓提供了錯誤信息

$ sudo mysql.server stop 
Password: 
Shutting down MySQL 
.. SUCCESS! 
$ sudo mysql.server start 
Starting MySQL 
SUCCESS! 
$ sudo mysql.server restart 
Shutting down MySQL 
.. SUCCESS! 
Starting MySQL 
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/my.local.pid). 

我看了一下,答案在這裏:PID error on mysql.server start?

,但我得到了以下錯誤:

$ mysql_install_db 
FATAL ERROR: Could not find ./bin/my_print_defaults 

If you compiled from source, you need to run 'make install' to 
copy the software into the correct location ready for operation. 

If you are using a binary release, you must either be at the top 
level of the extracted archive, or pass the --basedir option 
pointing to that location. 

有什麼建議嗎?

回答

0

的東西夫婦,你可以嘗試:

  • 嘗試直重啓:

sudo /usr/local/mysql/support-files/mysql.server restart

  • 刪除的/etc/my.cnf(或重新命名它),然後重新啓動:

sudo mv /etc/my.cnf /etc/my.cnf.bak

sudo mysql.server restart

  • 刪除任何文件名爲.err或建立在錯誤信息缺失.pid mentionned(對我來說這一個工作)

rm *.err /usr/local/mysql/data/

rm /usr/local/var/mysql/*.err

  • 簡le mysql重新安裝

希望其中之一爲您服務!

0

它很可能是一個權限問題。嘗試使用此命令解決它:

$ sudo chown _mysql /usr/local/var/mysql/*

$ sudo chown -R _mysql:_mysql /usr/local/var/mysql

這也可能是mysql的文件夾有一個權限問題:

$ sudo chmod -R 777 /usr/local/var/mysql/