Home >Database >Mysql Tutorial >Why is phpMyAdmin Failing to Connect to MySQL 8.0 Due to \'[caching_sha2_password]\' Authentication?

Why is phpMyAdmin Failing to Connect to MySQL 8.0 Due to \'[caching_sha2_password]\' Authentication?

Linda Hamilton
Linda HamiltonOriginal
2024-11-23 14:55:18362browse

Why is phpMyAdmin Failing to Connect to MySQL 8.0 Due to

phpMyAdmin on MySQL 8.0

Issue:

Accessing MySQL 8.0 with phpMyAdmin results in errors related to an unknown authentication method during client connection, specifically "[caching_sha2_password]".

Solution:

To resolve this issue, it is necessary to modify the MySQL Authentication Plugin and password:

  1. Log in to the MySQL Console:
mysql -u root -pPASSWORD
  1. Change the Authentication Plugin:
ALTER USER root IDENTIFIED WITH mysql_native_password BY 'PASSWORD';
  1. Set the Password:

Replace 'PASSWORD' with the desired password.

Additional Notes:

  • Ensure the given password matches the one used when linking phpMyAdmin with the MySQL server.
  • If using docker images, the authentication plugin can be changed directly in the image configuration.
  • This solution provides a quick fix for development environments, but it is not recommended to change the MySQL Preferred Authentication Plugin.
  • Refer to the MySQL 8.0 Reference Manual for further information on the Preferred Authentication Plugin.

The above is the detailed content of Why is phpMyAdmin Failing to Connect to MySQL 8.0 Due to \'[caching_sha2_password]\' Authentication?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn