mysql> mysql -u root -p #登陆mysql
mysql> use mysql; # 切换mysql数据库
mysql> select user,plugin from user where user='root'; #查看root的加密方式
mysql> alter user 'root'@'localhost' identified with mysql_native_password by '123456';
mysql> flush privileges;