Warning: World-writable config file '/etc/my.cnf' is ignored

1. 问题描述:mysql

重启mysql服务时出现如下信息:git

Warning: World-writable config file '/etc/my.cnf' is ignoredgithub

出现这种状况的缘由是:mysql故意不让用户重写my.cnf,权限默认是644, 即-rw-r--r--, 若是权限不是644, 则会出现这种状况。sql

2. 解决方法:rest

(1) 查看my.cnf文件的权限:git@github.com:DJISZ/marketevent.gitserver

ls -l /etc/my.cnfit

信息以下:event

cryhelyxx@ada:~$ ls -l /etc/my.cnftable

-rw-r--r-- 1 root root 1126  4月 13 16:46 /etc/my.cnffile

cryhelyxx@ada:~$

能够看到my.cnf文件权限为644, 若是你的my.cnf文件权限不是"-rw-r--r--", 而是如“-rwxrwxrwx”等等, 则执行如下命令:

sudo chmod 644 /etc/my.cnf

(2) 进入mysql目录下:

cd /usr/local/mysql/

(3) 重启mysql服务:

sudo ./support-files/mysql.server restart

3. OK, Enjoy it!!!

相关文章
相关标签/搜索