Home >Database >Mysql Tutorial >MySQL 8: How to Fix \'Unable to load authentication plugin \'caching_sha2_password\'\'?

MySQL 8: How to Fix \'Unable to load authentication plugin \'caching_sha2_password\'\'?

Susan Sarandon
Susan SarandonOriginal
2024-11-29 04:21:09355browse

MySQL 8: How to Fix

Resolving the "Unable to load authentication plugin 'caching_sha2_password'" Issue

Problem:

While starting an application in Eclipse, an error message is encountered: "Could not discover the dialect to use. java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'."

Cause:

Starting with MySQL 8.0.4, the default authentication plugin for the MySQL server has changed from "mysql_native_password" to "caching_sha2_password."

Solution:

To resolve this issue, follow these steps:

  1. Execute the following command to change the default authentication plugin back to "mysql_native_password" for the specified user:
ALTER USER 'student'@'localhost' IDENTIFIED WITH mysql_native_password BY 'pass123';
  1. Replace "student" and "pass123" with the actual username and password of the user you want to connect with.

Additional Information:

For a more detailed explanation, refer to the MySQL Reference Manual at: https://dev.mysql.com/doc/refman/8.0/en/mysql-native-password.html

The above is the detailed content of MySQL 8: How to Fix \'Unable to load authentication plugin \'caching_sha2_password\'\'?. 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