【发布时间】:2021-11-29 17:37:32
【问题描述】:
TypeError: __init__() takes 1 positional argument but 5 were given
这是错误,我将在下面分享脚本:
import pymysql
print('---DATABASE CONNECTION SAMPLE---')
x=pymysql.connect('localhost','root','sha@123','avodha')
cr=x.cursor()
cr.execute('create table student(name char(50),age int)')
x.close()
【问题讨论】:
-
connect只接受关键字参数
标签: python mysql typeerror pymysql