Mysql Docker Container連線一半就中斷 - Linux

By Elma
at 2016-08-25T05:24
at 2016-08-25T05:24
Table of Contents
請問一下我要如何在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
--
試著在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
--
Tags:
Linux
All Comments
Related Posts
ubuntu 14.04更新後無法開機

By Sandy
at 2016-08-24T16:11
at 2016-08-24T16:11
mbpr上ubuntu無法輸出 ~ 符號

By Ida
at 2016-08-24T14:21
at 2016-08-24T14:21
awk要擷取資訊會亂掉

By Freda
at 2016-08-23T20:50
at 2016-08-23T20:50
pi2利用wifi同時當成基地台及客戶端

By Yuri
at 2016-08-23T01:11
at 2016-08-23T01:11
rsync可以計算「預計」傳輸的量嗎?

By Joseph
at 2016-08-21T09:37
at 2016-08-21T09:37