bootcamp icon indicating copy to clipboard operation
bootcamp copied to clipboard

[BUG]: Can't connect to MySQL server

Open Devictor0815 opened this issue 2 years ago • 4 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

docker-compose正常执行,页面也生成了,但是无法加载图像,查了日志是显示默认数据库没连上 img-search-webserver | ConnectionRefusedError: [Errno 111] Connection refused img-search-webserver | img-search-webserver | During handling of the above exception, another exception occurred: img-search-webserver | img-search-webserver | Traceback (most recent call last): img-search-webserver | File "main.py", line 34, in img-search-webserver | MYSQL_CLI = MySQLHelper() img-search-webserver | File "/app/src/mysql_helpers.py", line 18, in init img-search-webserver | local_infile=True) img-search-webserver | File "/usr/local/lib/python3.7/site-packages/pymysql/connections.py", line 353, in init img-search-webserver | self.connect() img-search-webserver | File "/usr/local/lib/python3.7/site-packages/pymysql/connections.py", line 664, in connect img-search-webserver | raise exc img-search-webserver | pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on '172.16.238.11' ([Errno 111] Connection refused)") img-search-webserver | 2022-07-20 08:36:58,625 - 140416638048064 - milvus_helpers.py-milvus_helpers:19 - DEBUG: Successfully connect to Milvus with IP:172.16.238.10 and PORT:19530 img-search-webserver | Traceback (most recent call last): img-search-webserver | File "/usr/local/lib/python3.7/site-packages/pymysql/connections.py", line 614, in connect img-search-webserver | (self.host, self.port), self.connect_timeout, **kwargs img-search-webserver | File "/usr/local/lib/python3.7/socket.py", line 728, in create_connection img-search-webserver | raise err img-search-webserver | File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection img-search-webserver | sock.connect(sa) img-search-webserver | ConnectionRefusedError: [Errno 111] Connection refused img-search-webserver | img-search-webserver | During handling of the above exception, another exception occurred: img-search-webserver | img-search-webserver | Traceback (most recent call last): img-search-webserver | File "main.py", line 34, in img-search-webserver | MYSQL_CLI = MySQLHelper() img-search-webserver | File "/app/src/mysql_helpers.py", line 18, in init img-search-webserver | local_infile=True) img-search-webserver | File "/usr/local/lib/python3.7/site-packages/pymysql/connections.py", line 353, in init img-search-webserver | self.connect() img-search-webserver | File "/usr/local/lib/python3.7/site-packages/pymysql/connections.py", line 664, in connect img-search-webserver | raise exc img-search-webserver | pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on '172.16.238.11' ([Errno 111] Connection refused)") img-search-webserver | 2022-07-20 08:37:01,328 - 140564847376192 - milvus_helpers.py-milvus_helpers:19 - DEBUG: Successfully connect to Milvus with IP:172.16.238.10 and PORT:19530 img-search-webserver | Traceback (most recent call last): img-search-webserver | File "/usr/local/lib/python3.7/site-packages/pymysql/connections.py", line 614, in connect img-search-webserver | (self.host, self.port), self.connect_timeout, **kwargs

我安装的镜像: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ef3e0ba869dd milvusbootcamp/img-search-server:towhee0.6 "/bin/sh -c 'python3…" 58 minutes ago Up 58 minutes 0.0.0.0:5000->5000/tcp img-search-webserver 6b85cca94782 milvusdb/milvus:v2.0.2 "/tini -- milvus run…" 58 minutes ago Up 58 minutes 0.0.0.0:19530->19530/tcp milvus-standalone d7fd2dbd87e9 minio/minio:RELEASE.2020-12-03T00-03-10Z "/usr/bin/docker-ent…" 58 minutes ago Up 58 minutes (healthy) 9000/tcp milvus-minio 1381c84a10e3 mysql:5.7 "docker-entrypoint.s…" 58 minutes ago Up 58 minutes 0.0.0.0:3306->3306/tcp, 33060/tcp img-search-mysql a45988a86101 quay.io/coreos/etcd:v3.5.0 "etcd -advertise-cli…" 58 minutes ago Up 58 minutes 2379-2380/tcp milvus-etcd f7a2037328d7 milvusbootcamp/img-search-client:1.0 "/bin/bash -c '/usr/…" 58 minutes ago Up 58 minutes (unhealthy) 0.0.0.0:8001->80/tcp img-search-webclient

Devictor0815 avatar Jul 20 '22 09:07 Devictor0815

不知道这块怎么解决

Devictor0815 avatar Jul 20 '22 09:07 Devictor0815

兄弟有没有解决了?

winwill2012 avatar Aug 03 '22 08:08 winwill2012

@Devictor0815 One question is do you have your own MySQL in your machine? It seems like the setting of MySQL is only listening to the localhost, you can refer to it: 截屏2022-08-05 11 30 29

Of course, you can use your own MySQL by modify all mysql configuration in the docker-compose.yaml.

shiyu22 avatar Aug 05 '22 03:08 shiyu22

请问下这个问题解决了么,具体怎么解决的

ElegantGod avatar Sep 06 '22 03:09 ElegantGod