该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
回复 Alfator :
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pymysql\connections.py", line 582, in connect
**kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\socket.py", line 707, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\socket.py", line 748, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11004] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "G:\001\python\hello1.py", line 5, in
conn=pymysql.connect(host='180.76.183.79:3306',user='root',password='123456',database='top')
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pymysql\__init__.py", line 94, in Connect
return Connection(*args, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pymysql\connections.py", line 327, in __init__
self.connect()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pymysql\connections.py", line 629, in connect
raise exc
pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on '180.76.183.79:3306' ([Errno 11004] getaddrinfo failed)")