一、进入mysql 二、输入两条命令 命令一alter user 'root'@'localhost' identified with mysql_native_password by '123456'; 命令二flush privileges; 就可以了。