执行mysql_secure_installation出错

Failed! Error: SET PASSWORD has no significance for user \’root\’@\’localhost\’ as the authentication method used doesn\’t store authentication data in the MySQL server. Please consider using ALTER USER instead if you want to change authentication parameters.

sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'my-secret-password';

 

上面的my-secret-password换成你的新密码,好像必须有大写小写数字和符号,好要大于8位

再执行

exit;
sudo mysql_secure_installation

 

发表评论

您的邮箱地址不会被公开。 必填项已用 * 标注