2012-11-20 207 views
6

我每次重啓MySQL服務器如何重新啓動mysql服務器?

[email protected]:/$ sudo opt/bitnami/ctlscript.sh start server 

WWarning: World-writable config file '/opt/bitnami/mysql/my.cnf' is ignored 
Warning: World-writable config file '/opt/bitnami/mysql/my.cnf' is ignored 
121120 12:30:18 mysqld_safe Logging to '/opt/bitnami/mysql/data/mysqld.log'. 
121120 12:30:18 mysqld_safe Starting mysqld daemon with databases from /opt/bitnami/mysql/data 
121120 12:30:20 mysqld_safe mysqld from pid file /opt/bitnami/mysql/data/ip-10-136-14-170.pid ended 
/opt/bitnami/mysql/scripts/ctl.sh : mysql could not be started 

服務器,出現以下錯誤響應:

(2002, "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)")

請告訴我,我必須做的解決這個問題。

+0

這似乎是屬於服務器故障 –

+1

如果MySQL作爲服務安裝(大多數情況下),您可以執行'service mysqld restart'或'/etc/init.d/mysqld restart'。 我不知道任何亞馬遜/ aws或mysql-python或bitnami,但你可以嘗試。 – Martin

+1

不是一個真正的編程問題,關於stackoverflow的話題。嘗試'chmod 0644 /opt/bitnami/mysql/my.cnf'並重新啓動。如果它沒有幫助 - > serverfault – Gryphius

回答

21

如果MySQL安裝服務(這是大部分時間),你可以做service mysqld restart/etc/init.d/mysqld restart

您也可以使用startstopreload而不是restart

+1

謝謝,這很有幫助。 –

+1

另外,根據distro'/etc/init.d/mysql restart'(Debian 5.0.10) – Deus777