在pacharm中運行代碼,CharField欄位max_length=20,null=True都沒有實作,感覺就是運行了創建表的代碼沒什么變化,而且還報錯誤,求助,如何將這個warning消除
python3.7版本,mysql5.7版本
運行代碼:
from peewee import *
db = MySQLDatabase("spider",host="127.0.0.1",user="root",password="root")
class Person(Model):
name = CharField(max_length=20,null=True)
#name = CharField()
birthday = DateField()
class Meta:
database = db # This model uses the "people.db" database.
table_name="users"
if __name__=="__main__":
db.create_tables([Person])
報錯:
C:\Users\dolaemon_li\PycharmProjects\spider\venv\lib\site-packages\pymysql\cursors.py:170: Warning: (3090, "Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release.")
result = self._query(query)
uj5u.com熱心網友回復:
update 下 pymsql 試試。轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/120472.html
