在關閉數據庫的命令發現mysql關不了,提示Warning: World-writable config file '/etc/my.cnf' is ignored ,意思大概就是權限全局可寫,任何一個用戶均可以寫。mysql擔憂這種文件被其餘用戶惡意修改,因此忽略掉這個配置文件。這樣mysql沒法關閉。mysql
下面看下整個過程sql
重啓MySQL數據庫
1
2
3
4
|
[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的權限spa
1
2
|
[root@ttlsa ~]# ls -l /etc/my.cnf
-rwxrwxrwx 1 root root 4878 Jul 30 11:31 /etc/my.cnf
|
權限777,任何一個用戶均可以改my.cnf,存在很大的安全隱患.server
修復MySQL問題ip
1
|
[root@ttlsa ~]# chmod 644 /etc/my.cnf
|
my.cnf設置爲用戶可讀寫,其餘用戶不可寫.it
關閉MySQLtable
1
2
|
[root@ttlsa ~]# service mysqld stop
Shutting down MySQL..[ OK ]
|
MySQL關閉成功. 問題很簡單class