跳過受權方式,直接登陸!!python
1.以管理員身份打開cmdmysql
2.停掉mysql服務端sql
C:\WINDOWS\system32>net stop mysql MySQL 服務正在中止. MySQL 服務已成功中止。
3.執行以下命令跳過受權表ide
#跳過受權表 C:\WINDOWS\system32>mysqld --skip-grant-tables 2018-06-09 17:12:38 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path. 2018-06-09 17:12:38 0 [Note] mysqld (mysqld 5.6.40) starting as process 6052 ...4.
4.再次查看spa
5. 如今能夠任意的更改密碼,執行以下命令rest
6.刷新權限,執行命令code
flush privileges;
7.退出mysql。執行命令:exit,blog
8.讓用戶去加載權限,以管理員身份進入cmd,查看當前mysql進程進程
1
|
tasklist |findstr mysql
#查看當前mysql的進程
|
9.殺死當前的進程,執行以下命令ip
taskkill /F /PID 6052 # 殺死當前的進程pid
10.再次執行以下操做,還原