因为mysql8.0以后的版本,密码认证策略不一样,所以要改成5.7版本之前的认证策略 ALTER USER 'root'@'%' IDENTIFIED BY 'password';ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password'; 刷新权限 FLUSH PRIVILEGES;