身份验证插件'caching_sha2_password'无法在circleci/mysql中加载 [英] Authentication plugin 'caching_sha2_password' cannot be loaded in circleci/mysql
问题描述
我最近在CircleCi 2中测试代码时遇到了问题. 我们的config.yml部分:
I've recently encountered problems when testing code in CircleCi 2. Parts of our config.yml:
jobs:
build:
environment:
docker:
...
- image: circleci/mysql
- image: rabbitmq:3-alpine
working_directory: ~/webapp
steps:
...
- run:
name: Prepare DB
command: echo "create database" | mysql --host 127.0.0.1
使用
ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: Error loading shared library /usr/lib/mysql/plugin/caching_sha2_password.so: No such file or directory
Exited with code 1
ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: Error loading shared library /usr/lib/mysql/plugin/caching_sha2_password.so: No such file or directory
Exited with code 1
此错误仅在现在发生,并且尚未对Circle/mysql设置进行任何更改.
This error only occurred now, and no changes has been made to the circle / mysql setup.
例如 https://stackoverflow.com/a/49944625/2713641 已指定可以设置--default-authentication-plugin=mysql_native_password
标志,但是不知道这是否适用于此,或者不确定如何将其应用到循环ci设置中.
From e.g. https://stackoverflow.com/a/49944625/2713641 it is specified that one can set a --default-authentication-plugin=mysql_native_password
flag but not sure if that applies here, or how to apply it in a circle ci setup.
推荐答案
此问题是特定于mysql 8的(由Raymond指出),并且由于CircleCi将其最新的docker映像升级到mysql 8而发生了错误.解决我们特定情况(我们使用mysql 5.7)的方法只是为mysql docker image指定合适的标签:
This problem is mysql 8 specific (as pointed out by Raymond), and the error occured due to CircleCi upgrading their latest docker image to mysql 8. Therefore, the solution to our specific case (we are using mysql 5.7) was simply to specify the appropriate tag for the mysql docker image:
jobs:
build:
environment:
docker:
...
- image: circleci/mysql:5.7
这篇关于身份验证插件'caching_sha2_password'无法在circleci/mysql中加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!