我正在用compose file触发mysql:
version: "3"
services:
my-sql:
image: mysql
container_name: my-sql
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: passw0rd
MYSQL_USER: dbuser
MYSQL_PASSWORD: pass1234
MYSQL_DATABASE: connect_test
按以下方式查找容器的IP地址:
root@sevenos:~# docker inspect my-sql | grep IPAddress
"SecondaryIPAddresses": null,
"IPAddress": "",
"IPAddress": "172.18.0.2",
当我与 my-sql client
在容器外,我得到如下错误:
root@sevenos:~# mysql -uroot -ppassw0rd -h 172.18.0.2 -P 3306
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be
loaded: /usr/lib/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory
1条答案
按热度按时间eufgjt7s1#
您可以使用以下命令初始化docker以加载默认身份验证插件:
在运行之前,必须删除所有mysql卷:
有关更多详细信息,请参阅:https://github.com/passbolt/passbolt_docker/issues/103