MySQL cannot restart and reports the following error: Warning: World-writable config file '/etc/my. cnf' is an ignored solution: my. cnfisignored

Source: Internet
Author: User

MySQL cannot restart and reports the following error: Warning: World-writable config file '/etc/my. cnf' is an ignored solution: my. cnfisignored

Problem Analysis

The command for shutting down the database finds that mysql cannot be shut down, promptingWarning: World-writable config file '/etc/my.cnf' is ignored The permission is globally writable and can be written by any user. Mysql ignores this configuration file because it is maliciously modified by other users. In this way, mysql cannot be closed.

Next, let's take a look at the entire process.

Restart MySQL

[root@ttlsa ~]# service mysqld stopWarning: World-writable config file '/etc/my.cnf' is ignoredWarning: World-writable config file '/etc/my.cnf' is ignoredMySQL manager or server PID file could not be found![FAILED]

Mysql cannot be stopped.

View Permissions Of my. cnf

[root@ttlsa ~]# ls -l /etc/my.cnf-rwxrwxrwx 1 root root 4878 Jul 30 11:31 /etc/my.cnf

Permission 777, which can be changed by any usermy.cnfThere are great security risks.

Fix MySQL Problems

[root@ttlsa ~]# chmod 644 /etc/my.cnf

My. cnf is set to allow users to read and write, while other users cannot write.

Disable MySQL

[root@ttlsa ~]# service mysqld stopShutting down MySQL..[ OK ]

MySQL is closed successfully. The problem is very simple.

Summary

The above is all about this article. I hope this article will help you in your study or work. If you have any questions, please leave a message.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.