MySQL database root account permission loss problem Solving method

Source: Internet
Author: User
Tags mysql database phpmyadmin pkill

Root account permissions are lost we can hardly do a lot of things, today this article to introduce you to the MySQL database root account permissions to solve the problem, I hope the article can help you.

There are a lot of database operating software, online words phpmyadmin is very good software,

Compared to the pit dad is one of my machine with the AMH panel, encountered a very depressing thing.

We all know that in the absence of independent installation phpMyAdmin, the AMH panel database operation is amysql ...

This software... How to say, improper operation, caused by the consequences of the ash is often serious. (Other software improper operation will also make a big deal)

Due to the need to speed up the site, the database to migrate to Aliyun RDS, the database migration of course, the easiest way is direct migration, here is required for our open source database remote connection.

As a result of security issues, we default to the database links are set to the local localhost, then we need to change to%. OK extremely depressed is I after changing to%, in the Amysql panel operation,

It just caused my root account to have no authority ... direct equals account locked. Root does not have any permission to operate. Nima..

For me such a computer small white, this ni let me tears run Ah, just at the beginning do not know what reason when I almost have to roll back the disk has wood ....

There is no way, only their own first toss.

———————————————————–

Solution: First of all, you have to have the root of the server, or ... what the hell is that?

(Here's a very useful command: skip-grant-tables→ very helpful MySQL startup parameters)

Stop MySQL first; here it is recommended to stop MySQL normally and try not to Pkill because your pkill may lead to mysqld dead but Subsys.

If already pkill, then mysqld status again. Then stop.

Then run # Mysqld_safe–skip-grant-tables &

To run in the background, no longer running in the background, then open a terminal slightly. This & is very practical oh ~!

Then MySQL goes into our database, skips validation, and it doesn't have to be that much trouble directly MySQL into

then use MySQL;

Here we are. The utility update gives the root account permissions.

Update user Set Update_priv = ' Y ' where user = ' root ';

If I don't have all the permissions like I do ...

All fields in the updated Mysql.user table are y for n.

Update user Set Select_priv = ' Y ' where user = ' root ';

Update user Set Insert_priv = ' Y ' where user = ' root ';

Update user Set Update_priv = ' Y ' where user = ' root ';

Update user Set Delete_priv = ' Y ' where user = ' root ';

Update user Set Create_priv = ' Y ' where user = ' root ';

Update user Set Drop_priv = ' Y ' where user = ' root ';

Update user Set Reload_priv = ' Y ' where user = ' root ';

Update user Set Shutdown_priv = ' Y ' where user = ' root ';

Update user Set Process_priv = ' Y ' where user = ' root ';

Update user Set File_priv = ' Y ' where user = ' root ';

Update user Set Grant_priv = ' Y ' where user = ' root ';

Update user Set References_priv = ' Y ' where user = ' root ';

Update user Set Index_priv = ' Y ' where user = ' root ';

Update user Set Alter_priv = ' Y ' where user = ' root ';

Update user Set Show_db_priv = ' Y ' where user = ' root ';

Update user Set Super_priv = ' Y ' where user = ' root ';

Update user Set Create_tmp_table_priv = ' Y ' where user = ' root ';

Update user Set Lock_tables_priv = ' Y ' where user = ' root ';

Update user Set Execute_priv = ' Y ' where user = ' root ';

Update user Set Repl_slave_priv = ' Y ' where user = ' root ';

Update user Set Repl_client_priv = ' Y ' where user = ' root ';

Update user Set Create_view_priv = ' Y ' where user = ' root ';

Update user Set Show_view_priv = ' Y ' where user = ' root ';

Update user Set Create_routine_priv = ' Y ' where user = ' root ';

Update user Set Alter_routine_priv = ' Y ' where user = ' root ';

Update user Set Create_user_priv = ' Y ' where user = ' root ';

Update user Set Event_priv = ' Y ' where user = ' root ';

Update user Set Trigger_priv = ' Y ' where user = ' root ';

Permission issues finally make sure that the "localhost" and "%" in the "mysql.user" table have all the permissions of root.

OK, if you want to modify the password and then change the root of the database password, but change to remember to modify the site relative to the file Ah

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.