Home  >  Article  >  Database  >  Here are some question-based titles for your article: **Direct and Clear:** * **MySQL 8.0.11 Connection Error: \"Cannot connect to MySQL server, authentication plugin: caching_sha2_password\&qu

Here are some question-based titles for your article: **Direct and Clear:** * **MySQL 8.0.11 Connection Error: \"Cannot connect to MySQL server, authentication plugin: caching_sha2_password\&qu

Patricia Arquette
Patricia ArquetteOriginal
2024-10-26 08:38:02523browse

Here are some question-based titles for your article:

**Direct and Clear:**

* **MySQL 8.0.11 Connection Error:

Troubleshooting MySQL 8.0.11 Connection Issue: "Cannot connect to MySQL server, authentication plugin: caching_sha2_password"

Problem:

Upon attempting to connect to MySQL server 8.0.11 using MySQL workbench, an error message arises: "Cannot connect to MySQL server, authentication plugin: caching_sha2_password: the specified module could not be found."

Solution:

To rectify this issue, follow these steps:

  1. Locate the my.ini configuration file and modify the [mysqld] section as follows:

    • Comment out the "default_authentication_plugin=caching_sha2_password" line with a # character.
    • Add a new line "default_authentication_plugin=mysql_native_password".
  2. Connect to your MySQL server using the root user from the command line:

    <code class="bash">mysql -u root -p</code>
  3. Execute the following query:

    <code class="sql">ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'xxx';</code>

    where "xxx" represents your current password.

  4. Restart the MySQL server.

Now, you should be able to connect to your MySQL server successfully without encountering the previously observed error.

The above is the detailed content of Here are some question-based titles for your article: **Direct and Clear:** * **MySQL 8.0.11 Connection Error: \"Cannot connect to MySQL server, authentication plugin: caching_sha2_password\&qu. 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