Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

执行mysql_db文件出现报错,请教一下怎么解决 #2

Open
bcaixl opened this issue Aug 3, 2018 · 1 comment
Open

执行mysql_db文件出现报错,请教一下怎么解决 #2

bcaixl opened this issue Aug 3, 2018 · 1 comment

Comments

@bcaixl
Copy link

bcaixl commented Aug 3, 2018

报错内容:pymysql.err.InternalError: (1364, "Field 'create_time' doesn't have a default value")

(PS:虽然在数据库中设置createtime这一项为“允许空值”可以解决,但是这样就没有创建时间了。所以不想用这个办法)

@defnngj
Copy link
Owner

defnngj commented Aug 6, 2018

设置字段为空时取当前时间。

ALTER TABLE  `sign_event` CHANGE  `create_time`  `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
ALTER TABLE  `sign_guest` CHANGE  `create_time`  `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants