您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

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

bubuko 2022/1/25 19:58:34 mysql 字数 5044 阅读 645 来源 http://www.bubuko.com/infolist-5-1.html

原文:MySQL无法启动问题解决Warning: World-writable config file ‘/etc/my.cnf’ is ignored 今天重启一台内网服务器,发现mysql无法正常重启,执行systemctl start mysql,报错如下 Starting LSB: star... ...
原文:MySQL无法启动问题解决Warning: World-writable config file ‘/etc/my.cnf’ is ignored

  • 今天重启一台内网服务器,发现mysql无法正常重启,执行systemctl start mysql,报错如下
    Starting LSB: start and stop MySQL...
    Dec 11 14:24:42 localhost.localdomain mysql[32329]: my_print_defaults: [Warning] World-writable config file ‘/etc/my.cnf‘ is ignored.
    Dec 11 14:24:42 localhost.localdomain mysql[32329]: Starting MySQL.my_print_defaults: [Warning] World-writable config file ‘/etc/my.cnf‘ is ignored.
    Dec 11 14:24:42 localhost.localdomain mysql[32329]: my_print_defaults: [Warning] World-writable config file ‘/etc/my.cnf‘ is ignored.
    Dec 11 14:24:42 localhost.localdomain mysql[32329]: Logging to ‘/usr/local/mysql/data/localhost.localdomain.err‘.
    Dec 11 14:24:43 localhost.localdomain mysql[32329]: ERROR! The server quit without updating PID file (/usr/local/mysql/data/localhost.localdomain.pid).
    Dec 11 14:24:43 localhost.localdomain systemd[1]: mysql.service: control process exited, code=exited status=1

  • 刚开始关注点放在了 ERROR! The server quit without updating PID file (/usr/local/mysql/data/localhost.localdomain.pid). 这里,发现mysql下没有data这个文件夹,以为数据库文件丢失了呢,头疼。

  • 后来将关注点放到 my_print_defaults: [Warning] World-writable config file ‘/etc/my.cnf‘ is ignored.

    • 查看my.cnf的权限,
    • ls -l /etc/my.cnf
    • -rwxrwxrwx 1 root root 1404 Oct 16 19:31 /etc/my.cnf , 发现是777权限
    • chmod 644 /etc/my.cnf , 设置为644权限
    • systemctl start mysql , 一切OK
  • 另外,发现无法远程连接,之前设置过IP,用户访问权限,但还是重新设置了一遍,并开放端口3306,才可以远程连接(由于设置权限和开放端口没有分开执行,所以并未确定是端口还是权限造成的)。

    GRANT ALL PRIVILEGES ON *.* TO ‘username ‘@‘%‘ IDENTIFIED BY ‘password‘ WITH GRANT OPTION;

    FLUSH   PRIVILEGES;

    iptables -I INPUT -p tcp --dport 3306-j ACCEPT
    
    远程连接成功

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

原文:https://www.cnblogs.com/lonelyxmas/p/12677171.html


如果您也喜欢它,动动您的小指点个赞吧

除非注明,文章均由 laddyq.com 整理发布,欢迎转载。

转载请注明:
链接:http://laddyq.com
来源:laddyq.com
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


联系我
置顶