cover of episode Выпуск №42 - MySQL 8 и caching_sha2_password

Выпуск №42 - MySQL 8 и caching_sha2_password

2018/11/29
logo of podcast Пятиминутка PHP

Пятиминутка PHP

Shownotes Transcript

На днях решил попробовать MySQL 8, но при подключении из PHP получил ошибку. Погуглил, нашел советы по исправлению на StackOverflow и в различных блогах - слепое выполнение найденных инструкции исправило ситуацию, подключение заработало, но это не наш путь! Надо разобраться, что собственно происходит и как правильно поступить?

Результаты подключения к MySQL 8.0.13 из различных версий PHP для двух различных пользователей (mysql_native_password и cached_sha2_password) при значении по умолчания default-authentication-plugin=cached_sha2_password

PHP 7.2.5:

  • user_mysql_native: success
  • user_cached_sha2: The server requested authentication method unknown to the client [caching_sha2_password]

PHP 7.2.9:

  • user_mysql_native: Unexpected server respose while doing caching_sha2 auth: 109
  • user_cached_sha2: success

PHP 7.3.0RC5

  • user_mysql_native: success
  • user_cached_sha2: The server requested authentication method unknown to the client [caching_sha2_password]

Результаты подключения к MySQL 8.0.13 из различных версий PHP для двух различных пользователей (mysql_native_password и cached_sha2_password) при значении default-authentication-plugin=mysql_native_password

PHP 7.2.5:

  • user_mysql_native: success
  • user_cached_sha2: The server requested authentication method unknown to the client [caching_sha2_password]

PHP 7.2.9

  • user_mysql_native: success
  • user_cached_sha2: success

PHP 7.3.0RC5

  • user_mysql_native: success
  • user_cached_sha2: The server requested authentication method unknown to the client [caching_sha2_password]

Пятиминутка PHP - подкаст о новостях из мира PHP, интересных постах в блогах и современных подходах к разработке. https://5minphp.ru