MySQL無法重啓問題解決Warning: World-writable config file ‘/etc/my.cnf’ is ignored

今天幫朋友維護服務器,在關閉數據庫的命令發現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關閉成功. 問題很簡單


轉自http://www.ttlsa.com/mysql/warning-world-writable-config-file-etcmy-cnf-is-ignored/


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章