mysql_secure_installationの実行

メモ

※初期パスワードが必要になるのでパスワード確認が必要(初回起動時のパスワード確認:変更している場合は変更したパスワード)

#grep password /var/log/mysqld.log

mysql_secure_installation 実行

#mysql_secure_installation

現在の root のパスワード入力します。

 Enter password for user root:

新しいパスワードの設定します。

New password:

Re-enter new password:

※validate_passwordプラグインに沿ったパスワードを設定していないとエラーが表示されます。

MySQLのパスワードポリシー

… Failed! Error: Your password does not satisfy the current policy requirements

確認の入力を終えると、パスワードの強度が表示されます。

このパスワードで確定して次に進んで良いか聞かれるので、 「y(確定して次へ)」 を入力します。

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

匿名ユーザの削除

匿名ユーザ( anonymous user )を削除するか聞かれるので、「y(削除する)」 を入力します。

By default, a MySQL installation has an anonymous user,

allowing anyone to log into MySQL without having to have

a user account created for them. This is intended only for

testing, and to make the installation go a bit smoother.

You should remove them before moving into a production environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y

Success.

リモートからの root ユーザでのログイン禁止

リモートから root ユーザでログインできないようにします。ログインを禁止するかどうか聞かれるので、 「y(禁止する)」 を入力します。

Normally, root should only be allowed to connect from ‘localhost’. This ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y

Success.

※Success と表示されます。(リモートからの root ユーザのログインができなくなる)

test データベースの削除

デフォルトで作成されている test という名前のデータベースを削除するか聞かれるので、 「y(削除する)」 を入力します。

By default, MySQL comes with a database named ‘test’ that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment.

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y

Dropping test database…

Success.

Removing privileges on test database…

Success.

※test データベースの drop(削除)が行われ、test データベースに対する権限の削除も同時に実行されます。

リロード

権限テーブルをリロードして変更を有効にするか聞かれるので、「y(リロードする)」 を入力します。

Reloading the privilege tables will ensure that all changes made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y

Success.

※Success と表示されます。(権限テーブルの変更を有効化)

完了!

All done!

タイトルとURLをコピーしました