Authentication plugin 'caching_sha2_password' cannot be loaded

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

    Downloading a development release of 8.0.11-rc worked for me on a mac. with the following docker commands:

    docker run --name mysql -p 3406:3306 -e MYSQL_ROOT_PASSWORD=mypassword -d mysql
    
    0 讨论(0)
  • 2020-11-22 05:40

    you can change the encryption of the password like this.

    ALTER USER 'yourusername'@'localhost' IDENTIFIED WITH mysql_native_password BY 'youpassword';
    
    0 讨论(0)
  • 2020-11-22 05:42

    I had the same problem, but the answer by Aman Aggarwal didn't work for me with a Docker container running mysql 8.X. I loged in the container

    docker exec -it CONTAINER_ID bash
    

    then log into mysql as root

    mysql --user=root --password
    

    Enter the password for root (Default is 'root') Finally Run:

    ALTER USER 'username' IDENTIFIED WITH mysql_native_password BY 'password';
    

    You're all set.

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

    This is my databdase definition in my docker-compose:

    dataBase:
        image: mysql:8.0
        volumes:
            - db_data:/var/lib/mysql
        networks:
            z-net:
                ipv4_address: 172.26.0.2
        restart: always
        entrypoint: ['docker-entrypoint.sh', '--default-authentication-plugin=mysql_native_password']
        environment:
            MYSQL_ROOT_PASSWORD: supersecret
            MYSQL_DATABASE: zdb
            MYSQL_USER: zuser
            MYSQL_PASSWORD: zpass
        ports:
            - "3333:3306"
    

    The relevant line there is entrypoint.

    After build and up it, you can test it with:

    $ mysql -u zuser -pzpass --host=172.26.0.2  zdb -e "select 1;"
    Warning: Using a password on the command line interface can be insecure.
    +---+
    | 1 |
    +---+
    | 1 |
    +---+
    
    0 讨论(0)
  • 2020-11-22 05:46

    Currently (on 2018/04/23), you need to download a development release. The GA ones do not work.

    I was not able to connect with the latest GA version (6.3.10).

    It worked with mysql-workbench-community-8.0.11-rc-winx64.msi (from https://dev.mysql.com/downloads/workbench/, tab Development Releases).

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

    like this?

    docker run -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -d mysql --default-authentication-plugin=mysql_native_password
    mysql -uroot --protocol tcp
    

    Try in PWD

    https://github.com/GitHub30/docs/blob/change-default_authentication_plugin/mysql/stack.yml

    or You shoud use MySQL Workbench 8.0.11.

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