MySQL 5.6 中 TIMESTAMP 的变化:[Warning] TIMESTAMP with implicit DEFAULT value is。

jackxiang 2014-10-1 11:24 | |
查看mysql启动日志:
2014-10-01 11:08:45 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
这是数据库升级过程中,timestamp在5.6以前的数据库中默认not null,如果没有显示声明timestamp的默认值,那么该列用全0的”0000-00-00 00:00:00″作为默认值



加上还是会报这个问题,听说有一个坑,于是查了一下,这个Url有点用:http://cuelog.com/archives/4.html
如果初始化时出现
1  [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

在mysql的安装根目录下生成的my.cnf中加入:
2  explicit_defaults_for_timestamp = true

还是报错,按mysql提示的执行下面的mysql启动命令:
按mysql的说明,接下来是执行:
3  ./bin/mysqld_safe --user=mysql --explicit_defaults_for_timestamp=1 &

——————————————————————————————————————————————
来自:
http://www.kankanews.com/ICkengine/archives/110105.shtml
http://www.williamsang.com/archives/818.html

作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:http://jackxiang.com/post/7540/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!


最后编辑: jackxiang 编辑于2014-10-1 11:47
评论列表
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]