mysql-Django常见错误解决办法

一、报错:pymysql.err.IntegrityError: (1062, "Duplicate entry '15267' for key 'PRIMARY'")

原因:PRIMARY=15267 重复了,删除掉重新上传。

解决:登录mysql,删除掉PRIMARY=15267的记录。

二、[WARNING 2018-09-30 15:11:44,031] 16874: (1364, "Field 'bonus' doesn't have a default value")

django.db.transaction.TransactionManagementError: An error occurred in the current transaction. You can't execute queries until the end of the 'atomic' block.

解决:

进入mysql数据库,删除掉bonus字段,或者给个默认值搞定。

你可能感兴趣的:(mysql-Django常见错误解决办法)