I meet this problem when I use peewee to contect mysql first time. The code:

bizDb = peewee.MySQLDatabase('dbName',host="192.168.xx.xx", user="xxx", passwd="xxx", port=8898,db="my_database_name",                       charset="utf8")
bizDb.connect()

then I get:

TypeError: Connect() got multiple values for keyword argument 'db'

Where is wrong?

1 Answers

0
xiaohuo On

In peewee,the MySQLDatabase's first parameter 'dbName' is equal to 'db="my_database_name"',so must remove db="my_database_name",if not,they conflict and you will get the error.

btw:so freak design!