Linux MySQL root permission recovery

Source: Internet
Author: User

In order to securely set the Linux MySQL root permission, the Administrator account is not added after the setting .. Instead, I started to toss the database. There are many users in it, and the method of re-installation is not feasible .. Finally found a very good method !!

Step 1:

Servers with bad permissions ()

Server with MYSQL (B)

Stop the mysql service of machine A (service mysqld stop)

Rename the mysql folder in the mysql directory to mysql-old.

Download the mysql folder (the database folder, not the mysql directory) under/var/lib/mysql/on server B and upload it to server, then start mysql (service mysqld start)

Use phpmyadmin to enter after startup (do not forget when entering, because it has been replaced with mysql on server B, so the user name and password are in server B)

After logging on to the mysql database and entering the USERS table, you can see a lot of USERS (where the root user permission is N), and manually change all to Y. () Click to view the big picture.

 

In the last step, after modification, delete the mysql folder and change mysql-old to mysql! Start mysql! OK!

Note: Make sure to back up data when modifying mysql-old of server!

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.