我正在使用 Windows VPS 进行数据抓取。我使用 Python MySQL-Connector 将这些抓取的数据上传到 Linux 专用服务器。
import mysql.connector
mydb = mysql.connector.connect(
host="...",
user="...",
password="...",
database="...",
connection_timeout=60
)
mycursor = mydb.cursor()
大约25%的时间会出现失败,或者需要超过20秒的时间。当它失败时,我会得到一个10060错误。问题更可能是我的Linux服务器还是我的Windows VPS?真诚地感谢您的帮助。以下是错误消息:
2055: Lost connection to MySQL server at '[IP]:3306', system error: 10060 A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
bind-address=0.0.0.0
skip-name-resolve=1重启MySQL。 - dogs Cute