2016-07-13 50 views
0

之後,我重新安裝了mysql,但仍然得到:Can't connect to Error: local MySQL server through socket'/tmp/mysql.sock'(2)我不小心刪除了MySQL套接字文件('/tmp/mysql.sock')永久,我該如何解決它?

試圖啓動服務器:start mysql.server,但得到:

ERROR! The server quit without updating PID file (/usr/local/var/mysql/appledeMacBook-Pro-6.local.pid). 

我想接下來的事情是:

mysqladmin -h 127.0.0.1 -u root -p shutdown 

,並得到:

mysqladmin: connect to server at '127.0.0.1' failed 
error: 'Can't connect to MySQL server on '127.0.0.1' (61)' 
Check that mysqld is running on 127.0.0.1 and that the port is 3306. 
You can check this by doing 'telnet 127.0.0.1 3306' 

我跟着這個提示(telnet 127.0.0.1 3306),得到:

connect to address 127.0.0.1: Connection refused 
telnet: Unable to connect to remote host 

我該如何解決這個問題?

+1

刪除'.err'文件應該解決這個問題。 – Shravan40

+0

我重新安裝後,沒有任何* .err在usr/local/var/mysql – Danlang

回答

0

我希望你試過重新啓動你的機器,我希望你給mysql寫正確的權限。

1
  • ps aux | grep mysql
  • sudo kill -9 [PID]
  • sudo mysql.server start
+0

thx爲答案,我已經試過這種方式之前問,我發現這個過程的統計是S +或R +(這是所有後臺進程,並不能殺死甚至使用其他指令,如:pkill -9 mysql) – Danlang

相關問題