1、命令行登录mysql; 2、mysql>use mysql; 3、mysql>ALTER USER root IDENTIFIED WITH mysql_native_password BY '你的密码'; 4、mysql>FLUSH PRIVILEGES;