使用pymysql连接数据库一直失败,提示如下
“C:\Software management\python\python.exe” C:/flaskDemo-master/aaa.py
Traceback (most recent call last):
File “C:\Software management\python\lib\site-packages\pymysql\connections.py”, line 613, in connect
sock = socket.create_connection(
File “C:\Software management\python\lib\socket.py”, line 843, in create_connection
raise err
File “C:\Software management\python\lib\socket.py”, line 831, in create_connection
sock.connect(sa)
ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\flaskDemo-master\aaa.py”, line 7, in
db = pymysql.connect(host=“localhost”,port=3306, user=“root”, password=“123456”, db=“test”, charset=“utf8”, cursorclass=pymysql.cursors.DictCursor)
File “C:\Software management\python\lib\site-