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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Warning: World-writable config file '/etc/my.cnf' is ignored相关的知识,希望对你有一定的参考价值。

1. 问题描述:

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

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

出现这种情况的原因是:mysql故意不让用户重写my.cnf,权限默认是644, 即-rw-r--r--, 如果权限不是644, 则会出现这种情况。

2. 解决方法:

(1) 查看my.cnf文件的权限:[email protected]:DJISZ/marketevent.git

ls -l /etc/my.cnf

信息如下:

[email protected]:~$ ls -l /etc/my.cnf

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

[email protected]:~$

可以看到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!!!

以上是关于Warning: World-writable config file '/etc/my.cnf' is ignored的主要内容,如果未能解决你的问题,请参考以下文章

MySQL重启报Warning: World-writable config file ‘/etc/my.cnf’ is ignored

MySQL无法重启问题解决Warning: World-writable config file ‘/etc/my.cnf’ is ignored

the path component: '/var' is world-writable

/var/empty/ssdh must be owned by root and not group or world-writable

如何让 Pro*C 应对 #warning 指令?

登陆报错:-bash: warning: setlocale: LC_CTYPE: cannot c