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?
Чтобы эти функции были доступны, PHP должен быть собран с поддержкой модуля mysqli.
MySQL 8
При запуске PHP до версии 7.1.16 или PHP 7.2 до 7.2.4, установите плагин по умолчанию MySQL 8 Server в mysql_native_password, иначе вы увидите ошибки, похожие на The server requested authentication method unknown to the client [caching_sha2_password], даже когда caching_sha2_password не используется.
Это связано с тем, что MySQL 8 по умолчанию использует caching_sha2_password,
и плагин не распознается старыми версиями PHP (mysqlnd). Вместо этого измените
это, установив
default_authentication_plugin=mysql_native_password
в
my.cnf. Плагин caching_sha2_password
будет поддерживаться в будущей версии PHP. Пока же модуль
mysql_xdevapi поддерживает его.
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?