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

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

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

有什么解决办法吗?


当前回答

如果仍然希望使用新的身份验证方法,正确的解决方案是安装mariadb-connector-c包。对于Alpine,运行:

apk add mariadb-connector-c

这将添加缺少的caching_sha2_password。库到/usr/lib/mariadb/plugin/caching_sha2_password。So。

其他回答

我在M1 (arm64)中运行docker,在docker bash中直接更改的方式不适合我。相反,我将mysql映像更改为 mysql: 8.0.26 平台设置为 linux / x86_64 在my.cnf中添加default_authentication_plugin=mysql_native_password 然后,重新构建容器。

您可以像这样更改密码的加密。

ALTER USER 'yourusername'@'localhost' IDENTIFIED WITH mysql_native_password BY 'youpassword';

如果你像我一样在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!)

尝试在下载和安装MySql时使用传统密码,这对我有帮助。 或者遵循Santhosh Shivan为Mac OS发布的方法。

当所使用的工具与MySQL8不兼容时出现此错误,请尝试更新到MySQL Workbench的最新版本