MySQL无法重启问题解决Warning: World-writable config file ‘/etc/my.cnf’ is ignored
Posted adolfmc
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL无法重启问题解决Warning: World-writable config file ‘/etc/my.cnf’ is ignored相关的知识,希望对你有一定的参考价值。
权限777,任何一个用户都可以改my.cnf,存在很大的安全隐患.
修复MySQL问题
[[email protected] ~] # chmod 644 /etc/my.cnf |
my.cnf设置为用户可读写,其他用户不可写.
今天帮朋友维护服务器,在关闭数据库的命令发现mysql关不了,提示Warning: World-writable config file ‘/etc/my.cnf’ is ignored ,大概意思是权限全局可写,任何一个用户都可以写。mysql担心这种文件被其他用户恶意修改,所以忽略掉这个配置文件。这样mysql无法关闭。
下面看下整个过程
重启MySQL
[[email protected] ~] # 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的权限
[[email protected] ~] # ls -l /etc/my.cnf |
-rwxrwxrwx 1 root root 4878 Jul 30 11:31 /etc/my.cnf |
权限777,任何一个用户都可以改my.cnf,存在很大的安全隐患.
修复MySQL问题
[[email protected] ~] # chmod 644 /etc/my.cnf |
my.cnf设置为用户可读写,其他用户不可写.
关闭MySQL
[[email protected] ~] # service mysqld stop |
Shutting down MySQL..[ OK ] |
MySQL关闭成功. 问题很简单
转自http://www.ttlsa.com/mysql/warning-world-writable-config-file-etcmy-cnf-is-ignored/
以上是关于MySQL无法重启问题解决Warning: World-writable config file ‘/etc/my.cnf’ is ignored的主要内容,如果未能解决你的问题,请参考以下文章
?/var/lib/gems/2.5.0/gems/seccomp-tools-1.3.0/lib/seccomp-tools/dumper.rb:125: warning: Insecure wor
Warning: Unit file of mysql.service changed on disk, 'systemctl daemon-reload' recommended.(
MySQL重启报Warning: World-writable config file ‘/etc/my.cnf’ is ignored
案例利用innodb_force_recovery 解决MySQL服务器crash无法重启问题