pyth项目时报错:TypeError: __init__() takes 1 positional a行行rg
python 数据脚本迁移时报错:TypeError: __init__() takes 1 positional argument but 5 positional arguments (and 1 keyword-only argument) were given
迁移服务后,可能是因为mysql版本或者pymysql的版本有变化,导致不能再这么简单的写了,传参规则变得规范了
将传参的参数名加上
conn = pymysql.connect(host=self.host, user=self.username, password=self.pwd, database=self.dbname, charset="utf8")