mita2 database life

主にMySQLに関するメモです

MySQL 各バージョンの caching_sha2_password 対応状況まとめ

自分用のメモです。

MySQL 5.7

  • デフォルトは mysql_native_password
  • caching_sha2_password は利用できない
  • ただし、クライアントは caching_sha2_password をサポート

MySQL 8.0

  • デフォルト は caching_sha2_password
    • default_authentication_plugin パラメータを変更し、デフォルトを mysql_native_password にすることも可能
  • mysql_native_password も 利用可能

MySQL 8.4

  • デフォルト は caching_sha2_password
  • default_authentication_plugin パラメータは削除された
  • mysql_native_password を利用するには、mysql_native_password=on 設定が必要

MySQL 9.0 (Innovation Release)

  • mysql_native_password は削除
  • クライアントは引き続き、mysql_native_password をサポート
$ rpm -qli mysql-community-client-plugins-9.0.1-1.el9.x86_64 | grep native
/usr/lib64/mysql/plugin/mysql_native_password.so

クラウドの設定状況

2024.09.21 時点の状況です。

8.0 世代 の default_authentication_plugin の値

クラウドでは default_authentication_pluginmysql_native_password に調整されている。

default_authentication_plugin の値
MySQL Community caching_sha2_password
AWS RDS mysql_native_password
AWS Aurora mysql_native_password
Google Cloud SQL mysql_native_password

8.4 世代

AWS RDS MySQL はデフォルトで、mysql_native_password=on してくれている。

Cloud SQLmysql_native_password は有効化されているものの、新規のパスワードには利用できない

mysql> CREATE USER user84 IDENTIFIED WITH mysql_native_password BY 'MySQL8.4';
ERROR 4052 (HY000): Invalid plugin "mysql_native_password" specified as 1 factor during "CREATE USER".

8.4 にアップグレードする前に作られたユーザのみ継続利用できる。

mysql_native_password
MySQL Community -
AWS RDS *1 ON
AWS Aurora -
Google Cloud SQL

*1:RDS Preview 版で確認