我最近在 CircleCi 2 中测试代码时遇到了问题。我们的 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
Prepare DB
构建失败
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 设置进行任何更改。
从例如https://stackoverflow.com/a/49944625/2713641中指定可以设置一个--default-authentication-plugin=mysql_native_password
标志,但不确定是否适用于此处,或者如何在圆形 ci 设置中应用它。