1、cmd窗口登陆mysql:mysql -u root -p
2、Enter password:输入你设置过的数据库密码;
3、mysql> alter user ‘root’@‘localhost’ identified with mysql_native_password by ‘1234’;
Query OK, 0 rows affected (0.07 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)