登入mysql
> mysql -u root -p
#接着输入你的密码
mysql> use mysql;
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'r
oot';
Query OK, 0 rows affected (0.40 sec)
mysql> SELECT plugin FROM mysql.user WHERE User = 'root';
+-----------------------+
| plugin |
+-----------------------+
| mysql_native_password |
+-----------------------+
1 row in set (0.00 sec)