mysql恢复root默认权限

  1. 1. 停止mysql
  2.  
  3. 2. 以安全模式启动mysql
  4. mysqld_safe  --skip-grant-tables &
  5.  
  6. 3. 进入mysql;
  7. update mysql.user set Select_priv='Y', Insert_priv='Y',Update_priv='Y',Delete_priv='Y',
  8.         Create_priv='Y',Drop_priv='Y',Reload_priv='Y',Shutdown_priv='Y',
  9.         Process_priv='Y',File_priv='Y',Grant_priv='Y',References_priv='Y',
  10.         Index_priv='Y',Alter_priv='Y',Show_db_priv='Y',Super_priv='Y',
  11.         Create_tmp_table_priv='Y',Lock_tables_priv='Y',Execute_priv='Y',
  12.         Repl_slave_priv='Y',Repl_client_priv='Y',Create_view_priv='Y',
  13.         Show_view_priv='Y',Create_routine_priv='Y',Alter_routine_priv='Y',
  14.         Create_user_priv='Y',Event_priv='Y',Trigger_priv='Y' where User='root';

强帖留名: