mysql建表出现Timestamp错误
2015-07-03 10:44
399 查看
mysql建表时如果有两个或以上的字段为Timestamp,那么可能会出现如下错误:
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也能成功建表,但是反过来就不行...
转载于:https://www.cnblogs.com/zhi-hao/p/4617981.html
相关文章推荐
- MySql Date_Format()出现"bad format for timestamp"错误???
- mysql建表出现Timestamp错误
- MySQL出现错误1205-Lock wait timeout exceeded; try restarting transaction
- 安装MySQL后出现发生系统错误2或者系统找不到指定的文件
- 第一次配置mysql是出现错误:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
- 源码安装mysql出现 No curses/termcap library found 错误
- 兔子--安装或者卸载mysql服务出现Install/Remove of the Service Denied!错误
- mysql 启动出现相关错误。
- MySQl出现1067错误(可借鉴与其他服务启动错误原因)
- 安装MySql后,开机出现 缺少根元素 的错误提示。
- mysql导入数据库时出现40101错误解决方法
- 在Centos上安装MySQL时出现这样的错误:Starting MySQL.. ERROR! The server quit without updating PID file (/usr/loca
- mysql同步出现1062错误
- [备忘] Mysql操作出现Error writing file '/tmp/MYAkvdjr'错误
- mysql中常出现的错误
- ubuntu上在使用c/c++连接mysql时,出现undefined reference错误解决办法
- Perl中DBI、DBD::mysql模块的安装和可能出现的错误解决方法
- java连接MySQL出现版本错误及连接数据库代码
- JSP连接MySQL时出现--错误:Access denied for user 'root'@'localhost' (using password: YES)'解决方案
- 网站搬家MySql出现#1036 - Table ' ' is read only 错误提示