pymysql connected to mysql : Network is unreachable #13142

Closed
opened 2026-02-21 19:10:45 -05:00 by yindo · 1 comment
Owner

Originally created by @canghaiyisu666 on GitHub (Apr 20, 2025).

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Provide a description of requested docs changes

I use pymysql to connect local mysql docker service like this:
conn = pymysql.connect(host='192.168.10.17',port=3306, user='root', password='test')

192.168.10.17 is my windows ip address, both dify and mysql-server are installed in docker desktop in windows.

docker config state : Docker subnet: 192.168.65.0/24 ; ✔ Enable host networking
dify config state : "squid.conf.template" is the initial state.
windows firewall state: added rules for 3306 allowed in/out

BUT there is a execution error :

File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 711, in connect raise exc pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on '192.168.10.17' ([Errno 101] Network is unreachable)") error: exit status 255

Is there someone help??

Originally created by @canghaiyisu666 on GitHub (Apr 20, 2025). ### Self Checks - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Provide a description of requested docs changes I use pymysql to connect local mysql docker service like this: ` conn = pymysql.connect(host='192.168.10.17',port=3306, user='root', password='test')` 192.168.10.17 is my windows ip address, both dify and mysql-server are installed in docker desktop in windows. docker config state : Docker subnet: 192.168.65.0/24 ; ✔ Enable host networking dify config state : "squid.conf.template" is the initial state. windows firewall state: added rules for 3306 allowed in/out BUT there is a execution error : > File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 711, in connect raise exc pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on '192.168.10.17' ([Errno 101] Network is unreachable)") error: exit status 255 Is there someone help??
yindo closed this issue 2026-02-21 19:10:45 -05:00
Author
Owner

@yu-chao commented on GitHub (Apr 24, 2025):

https://zhuanlan.zhihu.com/p/27979994852 这个地址可以解决你问题 我已参考解决

@yu-chao commented on GitHub (Apr 24, 2025): https://zhuanlan.zhihu.com/p/27979994852 这个地址可以解决你问题 我已参考解决
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13142