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

Kenisha ·
更新时间:2024-09-20
· 667 次阅读

问题分析

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

总结

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

您可能感兴趣的文章:mysql中错误:1093-You can’t specify target table for update in FROM clause的解决方法mysql “ Every derived table must have its own alias”出现错误解决办法读取mysql一个库下面的所有的表tablemysql Event Scheduler: Failed to open table mysql.eventmysql中You can’t specify target table for update in FROM clause错误解决方法出现错误mysql Table ''performance_schema...解决办法



IS file 方法 etc config Mysql

需要 登录 后方可回复, 如果你还没有账号请 注册新账号
相关文章
Kamaria 2021-07-24
846