MySQL cannot be restarted and the system prompts "Warning: World-writable config file ".

Source: Internet
Author: User

When I restarted a machine today, I found that MySQL could not be restarted. The error "Warning: World-writable config file"/etc/my. cnf "is ignored.

Today, I helped my friend maintain the server. I found mysql could not be shut down by running the database command, and the prompt "Warning: World-writable config file"/etc/my. cnf is ignored, which generally means that permissions can be written globally 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

The Code is as follows: Copy code

[Root @ ttlsa ~]
# Service mysqld stop
Warning: World-writable config file '/etc/my. cnf' is ignored
Warning: World-writable config file '/etc/my. cnf' is ignored
MySQL manager or server PID file cocould not be found! [FAILED]


Mysql cannot be stopped.

View Permissions Of my. cnf

The Code is as follows: Copy code

[Root @ ttlsa ~]
# Ls-l/etc/my. cnf
-Rwxrwxrwx 1 root 4878 Jul 30 :31/etc/my. cnf


Permission 777. Any user can change my. cnf, which poses a major security risk.

Fix MySQL Problems

The Code is as follows: Copy code

[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

The Code is as follows: Copy code
[Root @ ttlsa ~]
# Service mysqld stop
Shutting down MySQL... [OK]

MySQL is closed successfully. The problem is very simple.

Related Article

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.