由于 mysql 8 中的新哈希算法,我无法在 gitlab 中针对此 mysql 版本成功运行 CI 测试。
我相信这也适用于其他 CI 引擎。
假设我的 .gitlab-ci.yml
就这么简单:
build:
stage: build
image: chilio/laravel-dusk-ci:stable
services:
- mysql:8.0
script:
- cp .env.example .env
- composer install
- php artisan migrate
这是我得到的错误:
SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
我找到了不同的帖子,关于重新配置 mysql 实例,但这张图片是官方的 mysql docker,我相信它应该以相同的方式工作,跨不同的版本......
从 mysql:5.5 到 5.7 的图像没有引入任何问题,但是对于 mysql:8.0,我得到如前所述的错误...
到目前为止,我还没有找到解决这个问题的方法。
有什么想法吗?
最佳答案
终于成功了。
在这种情况下,mysql 服务 应该以不同的方式调用:
services:
- name: mysql:latest
command: ["--default-authentication-plugin=mysql_native_password"]
关于php - 如何使用 mysql 8 docker 测试 laravel 5.6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51072111/