当前位置:   article > 正文

Warning: World-writable config file ‘/etc/my.cnf’ is ignored_world-writable config file is ignored

world-writable config file is ignored

今天用shell来直接登录MySQL,报错如下

liup@ubuntu:~$ mysql
Warning: World-writable config file '/etc/mysql/my.cnf' is ignored
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

‘/etc/my.cnf’ is ignored ,大概意思是权限全局可写,任何一个用户都可以写。mysql担心这种文件被其他用户恶意修改,所以忽略掉这个配置文件。导致无法进入,这也是mysql的安全机制之一。所以我们必须得改一些权限。设置其他用户不可写。

shell如下

chmod 644 /etc/my.cnf

然后执行:

service mysql restart 

即可。

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/1011334
推荐阅读
相关标签
  

闽ICP备14008679号