|
楼主 |
发表于 2021-1-2 19:08:50
|
显示全部楼层
还有就是 不知为何我无法使用pymysql
这是报错信息
Traceback (most recent call last):
File "/home/wallen/.local/lib/python3.9/site-packages/pymysql/connections.py", line 569, in connect
sock = socket.create_connection(
File "/usr/lib/python3.9/socket.py", line 822, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/usr/lib/python3.9/socket.py", line 953, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/wallen/demo.py", line 3, in <module>
db = pymysql.connect("lolcalhost","root","0xFFFFFFFF","dbforpymysql")
File "/home/wallen/.local/lib/python3.9/site-packages/pymysql/__init__.py", line 94, in Connect
return Connection(*args, **kwargs)
File "/home/wallen/.local/lib/python3.9/site-packages/pymysql/connections.py", line 327, in __init__
self.connect()
File "/home/wallen/.local/lib/python3.9/site-packages/pymysql/connections.py", line 619, in connect
raise exc
pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on 'lolcalhost' ([Errno -2] Name or service not known)") |
|