码迷,mamicode.com
首页 > 其他好文 > 详细

[Warning] TIMESTAMP with implicit DEFAULT value is deprecated.

时间:2017-07-28 22:27:29      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:timestamp   with   implicit   

2017-07-28T12:46:35.138596Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).


    其实这个报错在安装的初始化的时候就已经有了(在第一篇安装的文章中能看到),只不过没有影响安装和启动,所以并没有管,以为只是安装的时候检查类的报错,后来在重启mysql发现在error日志里面也会出现这个报错


解决方法:

在mysql官方网站上找到这么一段话

Those nonstandard behaviors remain the default for TIMESTAMP but as of MySQL 5.6.6 are deprecated and this warning appears at startup:


[Warning] TIMESTAMP with implicit DEFAULT value is deprecated.

Please use --explicit_defaults_for_timestamp server option (see

documentation for more details).

As indicated by the warning, to turn off the nonstandard behaviors, 

enable the new explicit_defaults_for_timestamp system variable at server startup. 

With this variable enabled, the server handles TIMESTAMP as follows instead:


这段话的意思是在5.6以后有这么一项检查,所以要开启标准的 explicit_defaults_for_timestamp功能,但是默认是关闭的。


在my.cnf中加入

[mysqld]

explicit_defaults_for_timestamp=true


如果还是报错,按mysql提示的执行下面的mysql启动命令:

./bin/mysqld_safe --user=mysql --explicit_defaults_for_timestamp=1 &


本文出自 “学习像树一样活着” 博客,请务必保留此出处http://laobaiv1.blog.51cto.com/2893832/1951798

[Warning] TIMESTAMP with implicit DEFAULT value is deprecated.

标签:timestamp   with   implicit   

原文地址:http://laobaiv1.blog.51cto.com/2893832/1951798

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!