Warning: World-writable config file ‘/etc/mysql/my.cnf‘ is ignored
今天用shell来直接登录MySQL,报错如下xeay@ubuntu:~$ mysqlWarning: World-writable config file '/etc/mysql/my.cnf' is ignoredERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mys
·
今天用shell来直接登录MySQL,报错如下
xeay@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
即可。
更多推荐
所有评论(0)