MySQL Database root privilege loss Solution

Source: Internet
Author: User

One day accidentally changed the root of the permissions to the smallest (only login, nothing can do), this may be urgent to me. Heavy-loaded words too troublesome, and there are many users, one after another do not know when.

Then I thought of a way, the current server to stop the MySQL service, the MySQL data directory under the MySQL directory renamed to Mysql_old, to another server under the MySQL directory/data/mysql directory to copy to the corresponding directory, Then start the MySQL service, log in to phpMyAdmin using the root account under another server, and you will see that you have full access to the operation, but there is no database project and user information in the current server in this data table. Then find the Mysql_old database, go in to the user table, find the first root localhost table segment, modify: Change all n to Y. Then stop the MySQL service, the newly copied MySQL deleted, the mysql_old renamed to MySQL, and then start the server with root login, found that the permissions have all returned.

MySQL Database root privilege loss Solution

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: 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.