Authentication plugin 'caching_sha2_password' cannot be loaded

前端 未结 30 2845
爱一瞬间的悲伤
爱一瞬间的悲伤 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 06:03

    Note: For MAC OS

    1. Open MySQL from System Preferences > Initialize Database >
    2. Type your new password.
    3. Choose 'Use legacy password'
    4. Start the Server again.
    5. Now connect the MySQL Workbench

    Image description

    0 讨论(0)
  • 2020-11-22 06:03
    • Open MySQL Command Line Client

    • Create a new user with a new pass

    Considering an example of a path to a bin folder on top, here's the code you need to run in the command prompt, line by line:

    cd C:\Program Files\MySQL\MySQL Server 5.7\bin
    MySQL -u root -p    
    current password...***  
    CREATE USER 'nativeuser'@'localhost'  
    IDENTIFIED WITH mysql_native_password BY 'new_password';
    
    • Then, you can access Workbench again (you should be able to do that after creating a new localhost connection and using the new credentials to start using the program).

    Set up a new local host connection with the user name mentioned above (native user), login using the password (new_password)

    Courtesy: UDEMY FAQs answered by Career365 Team

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

    If you are getting this error on GitLab CI like me: Just change from latest to 5.7 version ;)

    # .gitlab-ci.yml
    
    rspec:
      services:
        # - mysql:latest (I'm using latest version and it causes error)
        - mysql:5.7 #(then I've changed to this specific version and fix!)
    
    0 讨论(0)
  • 2020-11-22 06:05

    Almost like answers above but may be in simple queries, I was getting this error in my spring boot application along with hibernate after MySQL upgrade. We created a new user by running the queries below against our DB. I believe this is a temp work around to use sha256_password instead of latest and good authentication caching_sha2_password.

    CREATE USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'pa$$word';
    
    GRANT ALL PRIVILEGES ON * .* TO 'username'@'localhost';
    
    0 讨论(0)
  • 2020-11-22 06:05

    The below solution worked for me

    Go to Mysql Workbench -> Server-> Users and Privileges 1.Click Add Account

    2.Under Login Tab provide new details and make sure to choose the Authentication Type as standard and choose respective administrative roles and Schema Privileges

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

    If you are trying to connect to a MySQL server from a text-based MySQL client from another computer (be it Docker or not)

    Most answers here involve connecting from a desktop client, or ask you to switch to an older authentication method. If you're connecting it with the MySQL client (text-based), I made it work with a Debian Buster in a Docker container.

    Say you have the apt system and wget set up, do the following:

    1. sudo apt-get update
    2. sudo apt-get install lsb-release -y
    3. Download a Debian package which update apt sources for you from the MySQL web site.
    4. sudo dpkg -i mysql-apt-config_0.8.13-1_all.deb and select the options you want. In my case I only need MySQL Tools & Connectors to be enabled.
    5. sudo apt-get update
    6. sudo apt-get install mysql-client -y
    7. Done. You can now run the new MySQL client and connect with the new authentication method.
    0 讨论(0)
提交回复
热议问题