1. 程式人生 > >mysql5.7修改root密碼

mysql5.7修改root密碼

1.停止sql服務.

2.命令列方式啟動sql;mysqld在mysql資料夾的bin目錄下

mysqld –skip-grant-table

3.直接進入root使用者,此時無需密碼

mysql -u root

4.切換到mysql資料庫中.

use mysql

5.修改密碼,5.7版本的密碼欄位已經變成authentication_string了.

update mysql.user set authentication_string = password('123456') where user = 'root' and host = 'localhost';

6.重新整理下或者重啟,都可以.

flush privileges;

結束