源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

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

  • 时间:2021-06-06 16:18 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:MySQL无法重启报错Warning: World-writable config file ‘/etc/my.cnf’ is ignored的解决方法
[b]问题分析[/b] 在关闭数据库的命令发现mysql关不了,提示[code]Warning: World-writable config file '/etc/my.cnf' is ignored [/code],大概意思是权限全局可写,任何一个用户都可以写。mysql担心这种文件被其他用户恶意修改,所以忽略掉这个配置文件。这样mysql无法关闭。 [b]下面看下整个过程[/b] [b]重启MySQL[/b]
[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停止不了 [b]查看my.cnf的权限[/b]
[root@ttlsa ~]# ls -l /etc/my.cnf
-rwxrwxrwx 1 root root 4878 Jul 30 11:31 /etc/my.cnf
权限777,任何一个用户都可以改[code]my.cnf[/code],存在很大的安全隐患. [b]修复MySQL问题[/b]
[root@ttlsa ~]# chmod 644 /etc/my.cnf
my.cnf设置为用户可读写,其他用户不可写. [b]关闭MySQL[/b]
[root@ttlsa ~]# service mysqld stop
Shutting down MySQL..[ OK ]
MySQL关闭成功. 问题很简单 [b]总结[/b] 以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作能带来一定的帮助,如果有疑问大家可以留言交流。
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部