广告
返回顶部
首页 > 资讯 > 数据库 >[Warning] TIMESTAMP with implicit DEFAULT value is deprecated.
  • 677
分享到

[Warning] TIMESTAMP with implicit DEFAULT value is deprecated.

2024-04-02 19:04:59 677人浏览 薄情痞子
摘要

2017-07-28T12:46:35.138596Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use

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 &


您可能感兴趣的文档:

--结束END--

本文标题: [Warning] TIMESTAMP with implicit DEFAULT value is deprecated.

本文链接: https://www.lsjlt.com/news/44358.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作