Authentication plugin 'caching_sha2_password' cannot be loaded

前端 未结 30 2808
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 05:19

I am connecting MySQL - 8.0 with MySQL Workbench and getting the below error:

Authentication plugin \'caching_sha2_password\' cannot be loaded: dlop

相关标签:
30条回答
  • 2020-11-22 05:59

    For Windows 10:

    Open the command prompt:

    cd "C:\Program Files\MySQL\MySQL Server 8.0\bin"
    
    C:\Program Files\MySQL\MySQL Server 8.0\bin> mysql -u root -p
    Enter password: *********
    
    mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'newrootpassword';
    Query OK, 0 rows affected (0.10 sec)
    
    mysql> exit
    

    Alternatively, you can change the my.ini configuration as the following:

    [mysqld]
    
    default_authentication_plugin=mysql_native_password
    

    Restart the MySQL Server and open the Workbench again.

    0 讨论(0)
  • 2020-11-22 05:59

    Note: For Linux (Debian, Ubuntu, Mint)

    I got this error:

    MySQL Error Message: Plugin caching_sha2_password could not be loaded: /usr/lib/x86_64-linux-gnu/mariadb19/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory
    

    I solved with this steps:

    1. Enter on mysql console: $ mysql -u root -p, if you don't has a password for root user, then:

    2. Use mysql db: mysql> use mysql;

    3. Alter your user for solve the problem: mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

    4. Exit... mysql> quit;

    5. Done!

    0 讨论(0)
  • 2020-11-22 05:59

    Rolling back to the previous installations (to MySQL Community Server 5.7 and Workbench 6.1)and setting up new MySQL credentials worked for me!

    0 讨论(0)
  • 2020-11-22 06:01

    I was installing MySQL on my Windows 10 PC using "MySQL Web Installer" and was facing the same issue while trying to connect using MySQL workbench. I fixed the issue by reconfiguring the server form the Installer window.

    Clicking on the "Reconfigure" option it will allow to reconfigure the server. Click on "Next" until you reach "Authentication Method".

    Once on this tab, use the second option "Use Legacy Authentication Method (Retain MySQL 5.x Compatibility)".

    Keep everything else as is and that is how I solved my issue.

    0 讨论(0)
  • 2020-11-22 06:01

    For me this started happening because on a project, I was using Docker image mysql:latest (which was version 5, and which was working fine), and during a later build, the latest version was switched to version 8, and stopped working. I changed my image to mysql:5 and I was no longer getting this error.

    0 讨论(0)
  • 2020-11-22 06:01

    Actually MySql allows two type of authentication at the time of installation.

    1. Password Encryption
    2. Legacy Encryption

    Read Here

    So by checking legacy authentication the issue was resolved.

    0 讨论(0)
提交回复
热议问题