為什麼這篇docker mysql連線鄉民發文收入到精華區:因為在docker mysql連線這個討論話題中,有許多相關的文章在討論,這篇最有參考價值!作者jacobcan118 (jacobcan118)看板Linux標題[問題] Mysql Doc...
請問一下我要如何在host server上開啟多個mysql 的docker container.我開啟一個連線完全不會中斷但開啟第二個當我執行docker exec後卻出現connect refused
試著在my.cnf加上bind-address=0.0.0.0再重啟mysql不過還是一樣的情況. 謝謝
usr@ip-172-0-199-199:~$ docker exec devsite-db bash -c "mysql -h 172.17.0.4 -u user --password=passowrd tables < /dump.sql"
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2003 (HY000): Can't connect to MySQL server on '172.17.0.4' (111)
usr@ip-172-0-199-199:~$ telnet 172.17.0.4 3307
Trying 172.17.0.4...
telnet: Unable to connect to remote host: Connection refused
usr@ip-172-0-199-199:~$ ping 172.17.0.4
PING 172.17.0.4 (172.17.0.4) 56(84) bytes of data.
64 bytes from 172.17.0.4: icmp_seq=1 ttl=64 time=0.035 ms
64 bytes from 172.17.0.4: icmp_seq=2 ttl=64 time=0.036 ms
64 bytes from 172.17.0.4: icmp_seq=3 ttl=64 time=0.036 ms
^C
--- 172.17.0.4 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.035/0.035/0.036/0.006 ms
usr@ip-172-0-199-199:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
13724eb1c3a7 aa-dbimg "/entrypoint.sh mysql" 2 minutes ago Up About a minute 33060/tcp, 0.0.0.0:3307->3306/tcp aa-db
usr@ip-172-0-199-199:~$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
13724eb1c3a7 aa-dbimg "/entrypoint.sh mysql" 2 minutes ago Exited (1) 5 seconds ago aa-db
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 209.90.32.80
※ 文章網址: https://www.ptt.cc/bbs/Linux/M.1472073854.A.2E4.html