Gitlab Ci MySQL 8 mysql_native_password

Published 05-16-2019 13:56:07

错误

ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib/x86_64-linux-gnu/mariadb18/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory

mysql 5.7 到 mysql 8 不在默认使用 mysql_native_password

添加参数--default-authentication-plugin=mysql_native_password

test:
  stage: test
  services:
    - name: mysql:8
      command: ["mysqld", "--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci", "--default-authentication-plugin=mysql_native_password"]