PHP Velho Oeste 2024

要件

これらの関数を有効にするには、mysqli 拡張サポートを 有効にして PHP をコンパイルする必要があります。

MySQL 8

PHP 7.1.16 より前のバージョン、もしくは PHP 7.2.4 より前の 7.2系の PHP では、 MySQL 8 サーバーのデフォルトパスワードプラグインを mysql_native_password に設定するようにしてください。 さもないと、 The server requested authentication method unknown to the client [caching_sha2_password] のようなエラーを見ることになります。たとえあなたが caching_sha2_password を使っていなくても、です。

これは MySQL 8 のデフォルトが 古い PHP (mysqlnd) のリリースが認識していないプラグイン caching_sha2_password だからです。 かわりに、my.cnf の設定を default_authentication_plugin=mysql_native_password と変更してください。 caching_sha2_password プラグインは、 PHP 7.4.4 以降で完全にサポートされました。 これより前のバージョンでは、 mysql_xdevapi 拡張モジュールでサポートされています。

add a note add a note

User Contributed Notes 2 notes

up
-22
james at jmwhite dot co dot uk
3 years ago
PHP 7.4 now supports MySQL with caching_sha2_password, although it is a bit unclear around older versions, there seems to be conflicting reports. What is the support of caching_sha2_password in PHP < 7.4?
up
-59
alvaro at demogracia dot com
5 years ago
Supported authentication methods are listed in the "Loaded plugins" row of the "mysqlnd" section in phpinfo(). Look for plugins that start with "auth_plugin_…".
To Top