[Warning] TIMESTAMP with implicit DEFAULT value is deprecated.
admin
2023-05-17 03:01:56
0

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 &


相关内容

热门资讯

公交侧翻致2名学生去世,知情人... 极目新闻记者 柳琛琛5月16日晚,左权县安委办通报,16日7时17分,左权县石暴村附近发生一起公交车...
瞭望·治国理政纪事|进一步夯实... ◇2025年5月,习近平总书记在河南考察时指出,河南作为经济大省,要进一步夯实实体经济这个根基,以科...
特朗普:不希望看到台湾有人闹“... 据凤凰卫视报道,美国总统特朗普5月15日结束访华行程后,在接受福克斯新闻采访时谈到台湾问题,他表示不...
美军下一代空空导弹AIM-26... 【文/观察者网 山猫】据专业航空新闻网站“航空学家”(The Aviationist)5月15日报道...
燃气热水器多少升代表什么意思 燃气热水器的升数指的就是其每分钟的热水流量,这个流量等于(△T25℃×X流量)÷Y设定温度。可以简单...
燃气热水器鸣笛 1、强排式热水器本身与自来水管、烟管会造成共振声。2、强排式热水器风机的前清扫工作时发出的响声。3、...
热水器排烟管可以排到烟道吗 不可以,管道内有大量的油烟及高温,油烟和粉尘相互造成影响,二者混在一起时间长了就不能正常工作,废气也...
女子贴条提醒邻居“别在我家门口... “我带着耳塞睡觉,女邻居雇开锁师傅撬开了我家门,冲进来对我动手。”林女士回忆此事,直言当时一脸懵。凌...