0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

mysql_secure_installationコマンドがこけるようになった話

Posted at

最近になってmysqlのmysql_secure_installationコマンドのrootユーザーパスワード設定項目でエラーが出るようになっていました。
具体的なエラー

Please set the password for root here.
New password: (複雑なパスワード)
Re-enter new password: (複雑なパスワード)
Estimated strength of the password: 100 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
... 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.

どんなに複雑にしても怒られます…

解決法

あらかじめrootユーザーのパスワードを設定しておくとエラーが出ずに最後まで進めます。
※下の例ではデフォルト認証方式も変えてますが変えなくても良い

$ mysql ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<password>';
$ >mysql exit
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?