Method One:
MySQL mistakenly delete root
First step: Mysqld_safe--skip-grant-tables--skip-networking & (Skip password start)
Step two: Add Root table
Insert into user set user= ' root ', ssl_cipher= ', x509_issuer= ', x509_subject= ';
Step three: Root gives permission
Update user set host= ' localhost ', select_priv= ' y ', insert_priv= ' y ', update_priv= ' y ', alter_priv= ' y ', delete_priv= ' y ', create_priv= ' y ', drop_priv= ' y ', reload_priv= ' y ', shutdown_priv= ' y ', process_priv= ' y ', file_priv= ' y ', grant_priv= ' y ', references_priv= ' y ', index_priv= ' y ', create_user_priv= ' y ', show_db_priv= ' y ', super_priv= ' y ', create_tmp_table_priv= ' Y ', lock_tables_priv= ' y ', execute_priv= ' y ', repl_slave_priv= ' y ', repl_client_priv= ' y ', create_view_priv= ' y ', show_ view_priv= ' y ', create_routine_priv= ' y ', alter_routine_priv= ' y ', create_user_priv= ' y ' where user= ' root ';
Fourth step: Exit, log back in
Method Two:
To the other server's MySQL data path, copy the user.frm,user.myd,user.myi to the current problem server path, and then restart MySQL
This article is from the "OPS rookie" blog, please be sure to keep this source http://ckl893.blog.51cto.com/8827818/1682258
MySQL mistakenly delete root