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

来源:互联网 发布:lbe安全大师优化版 编辑:程序博客网 时间:2024/04/30 18:11
近来FreeBSD机器上的mysql服务重启、登录mysql、使用mysqldump备份数据库时报以下错误:
Warning: World-writable config file '/etc/my.cnf' isignored
解决方案:
This is  just a waring and can be ignored buthere is the solution how to fix it
这仅仅是一个警告,并且可以被忽略。但下面是修复它的解决方案。

MySQL is deliberately ignoring your config file (my.cnf) as asafety precaution because the file can be over-written by amalicious user.
MySQL有故意忽略你的配置文件(my.cnf)作为一种安全预防措施,因为该文件是能被恶意用户重写的。

To see the file’s permissions, use the followingcommand.
查看该文件的权限,使用如下命令
ls -l /etc/my.cnf
in response, you will see:
你能看到以下结果
-rw-r–r– 1 4998 Apr 2 2010/etc/my.cnf【注意:此处是最后需要修改成的权限,而你看到的应该是下面描述的两种权限】

If the first part of the line looks like “-rw-rw-rw-” or“rwxrwxrwx”, the file’s permissions are “World-writable”.
如果第一部分类似“-rw-rw-rw-” 或者“rwxrwxrwx”,那么该文件的权限就是全局可写的。

To fix this problem, use the following command to changefile’s permissions
要修改该问题,使用以下命令更改该文件的权限。

chmod 644 /etc/my.cnf

注意:一定要写为644,不要想当然的写为777