1.TypeError: __init__() takes 1 positional argument but 5 were given
使用 ps.connect("localhost", "root", "root123", "python") 连接mysql数据库报出如下错误:
db = ps.connect("localhost", "root", "root123", "python")
TypeError: __init__() takes 1 positional argument but 5 were given
连接参数指定即可,修改为下面:
ps.connect(host="localhost",user="root",password="root123",database="python")