sudo docker run -i -t f92f0896ed95 /bin/bash
[Entrypoint] MySQL Docker Image 5.7.21-1.1.3
bash-4.2# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
bash-4.2# 发布于 2018-02-14 01:43:20
您必须使用凭据配置~/.my.cnf,然后才能直接打开mysql shell。
内容示例:
[client]
user=dba
password=foobar
# depends of what is configured, can be a hostname or 127.0.0.1, it's matter :
host=localhost或者,如果您无法配置镜像,请执行以下操作:
mysql -h localhost -p然后,系统将提示您输入密码
发布于 2018-02-14 02:05:54
首先运行镜像标准,然后使用以下命令连接到正在运行的镜像:
docker exec -it f92f0896ed95 /bin/shhttps://stackoverflow.com/questions/48772606
复制相似问题