我正在连接MySQL - 8.0与MySQL工作台和得到以下错误:

无法加载认证插件“caching_sha2_password”: dlopen (/ usr /地方/ mysql / lib /插件/ caching_sha2_password。所以,2):图像 没有找到

我也尝试过其他客户端工具。

有什么解决办法吗?


当前回答

目前(2018/04/23),您需要下载开发版本。GA的不工作。

我无法连接到最新的GA版本(6.3.10)。

它适用于mysql-workbench-community-8.0.11-rc-winx64。msi(来自https://dev.mysql.com/downloads/workbench/,选项卡Development Releases)。

其他回答

对于那些使用Docker或Docker Compose的人,我遇到了这个错误,因为我没有设置我的MySQL镜像版本。Docker将自动尝试获取最新版本,即8。

我将MySQL设置为5.7并重新构建映像,它正常工作:

version: '2'
services: 
  db:
   image: mysql:5.7

这是我在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"

相关的行是入口点。

在构建和建立它之后,你可以用以下方法测试它:

$ 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 |
+---+

我也遇到了同样的问题,但是Aman Aggarwal的答案在运行mysql 8.X的Docker容器中对我不起作用。 我登录了集装箱

docker exec -it CONTAINER_ID bash

然后以root用户登录mysql

mysql --user=root --password

输入root密码(默认为'root') 最后运行:

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

你都准备好了。

下面的解决方案对我很有效

进入Mysql Workbench -> Server-> Users and Privileges 1.单击“添加帐户”

2.在登录选项卡下提供新的详细信息,并确保选择认证类型作为标准,并选择各自的管理角色和模式特权

如果你像我一样在GitLab上得到这个错误: 只要从最新版本更改到5.7版本即可;)

# .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!)