当前位置: 移动技术网 > IT编程>数据库>Mysql > MySQL无法重启报错Warning: World-writable config file ‘/etc/my.cnf’ is ignored的解决方法

MySQL无法重启报错Warning: World-writable config file ‘/etc/my.cnf’ is ignored的解决方法

2017年12月12日  | 移动技术网IT编程  | 我要评论

记金华的双龙洞课件,胡文丽,刷留言软件

问题分析

在关闭数据库的命令发现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关闭成功. 问题很简单

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作能带来一定的帮助,如果有疑问大家可以留言交流。

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网