import pymysql
import pymysql.cursors
connection = pymysql.connect(host='offer-system.000webhostapp.com',
port =21,
user='id5165068_team',
password = '123456',
db = 'id5165068_offersystem',
charset='utf8',
cursorclass=pymysql.cursors.DictCursor,
autocommit=True
)
=============================================== =========================
显示: (OperationalError:(2003,"无法连接到MySQL服务器' offer-system.000webhostapp.com'([WinError 10051]尝试对无法访问的网络进行套接字操作)& #34;
答案 0 :(得分:0)
鉴于错误
尝试对无法访问的网络执行套接字操作
似乎脚本无法访问mysql服务器。
代码本身似乎没有问题,所以我要检查: