MySQL無法重啟報錯Warning: World-writable config file ‘/etc/my.cnf’ is ignored的解決方法
更新時間:2016年12月04日 10:33:53 投稿:daisy
最近在維護公司服務器的時候,在關閉數據庫的命令發(fā)現mysql關不了了,提示錯誤為Warning: World-writable config file '/etc/my.cnf' is ignored,通過查找網上的資料終于解決了,現在將解決的方法分享給大家,同樣遇到這個問題的朋友們可以參考借鑒。
問題分析
在關閉數據庫的命令發(fā)現mysql關不了,提示Warning: World-writable config file '/etc/my.cnf' is ignored ,大概意思是權限全局可寫,任何一個用戶都可以寫。mysql擔心這種文件被其他用戶惡意修改,所以忽略掉這個配置文件。這樣mysql無法關閉。
下面看下整個過程
重啟MySQL
[root@ttlsa ~]# service mysqld stop Warning: World-writable config file '/etc/my.cnf' is ignored Warning: World-writable config file '/etc/my.cnf' is ignored MySQL manager or server PID file could not be found![FAILED]
可以看到mysql停止不了
查看my.cnf的權限
[root@ttlsa ~]# ls -l /etc/my.cnf -rwxrwxrwx 1 root root 4878 Jul 30 11:31 /etc/my.cnf
權限777,任何一個用戶都可以改my.cnf,存在很大的安全隱患.
修復MySQL問題
[root@ttlsa ~]# chmod 644 /etc/my.cnf
my.cnf設置為用戶可讀寫,其他用戶不可寫.
關閉MySQL
[root@ttlsa ~]# service mysqld stop Shutting down MySQL..[ OK ]
MySQL關閉成功. 問題很簡單
總結
以上就是這篇文章的全部內容了,希望本文的內容對大家的學習或者工作能帶來一定的幫助,如果有疑問大家可以留言交流。
您可能感興趣的文章:
- mysql中錯誤:1093-You can’t specify target table for update in FROM clause的解決方法
- mysql “ Every derived table must have its own alias”出現錯誤解決辦法
- 讀取mysql一個庫下面的所有的表table
- mysql Event Scheduler: Failed to open table mysql.event
- mysql中You can’t specify target table for update in FROM clause錯誤解決方法
- 出現錯誤mysql Table ''performance_schema...解決辦法
相關文章
解決MySQL報錯Error 3948 (42000): Loading loc
在執(zhí)行MySQL項目過程中意外出現的報錯,之前也沒有遇到過,報錯信息如下,Error 3948 (42000): Loading local data is disabled; this must be enabled on both the client an,本文小編就給大家介紹一下解決報錯的方法,需要的朋友可以參考下2023-09-09

