权限777,任何一个用户均可以改my.cnf,存在很大的安全隐患.mysql
修复MySQL问题sql
[root@ttlsa ~] # chmod 644 /etc/my.cnf |
my.cnf设置为用户可读写,其余用户不可写.数据库
今天帮朋友维护服务器,在关闭数据库的命令发现mysql关不了,提示Warning: World-writable config file ‘/etc/my.cnf’ is ignored ,大概意思是权限全局可写,任何一个用户均可以写。mysql担忧这种文件被其余用户恶意修改,因此忽略掉这个配置文件。这样mysql没法关闭。安全
下面看下整个过程服务器
重启MySQLspa
[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中止不了code
查看my.cnf的权限server
[root@ttlsa ~] # ls -l /etc/my.cnf |
-rwxrwxrwx 1 root root 4878 Jul 30 11:31 /etc/my.cnf |
权限777,任何一个用户均可以改my.cnf,存在很大的安全隐患.string
修复MySQL问题it
[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/