当前位置:Gxlcms > 数据库问题 > mysql建表出现Timestamp错误

mysql建表出现Timestamp错误

时间:2021-07-01 10:21:17 帮助过:4人阅读

Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE

原因是当你给一个timestamp设置为on updatecurrent_timestamp的时候,其他的timestamp字段需要显式设定default值

但是如果你有两个timestamp字段,但是只把第一个设定为current_timestamp而第二个没有设定默认值,mysql也能成功建表,但是反过来就不行...

mysql建表出现Timestamp错误

标签:

人气教程排行