找回密码
 新建账号

MySQL [Warning] TIMESTAMP with implicit DEFAULT value is deprecated

[复制链接]
php 发表于 2016/9/30 01:26 | 显示全部楼层 |阅读模式
[Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
[Warning] 'ERROR_FOR_DIVISION_BY_ZERO' is deprecated and will be removed in a future release.
[Warning] 'NO_ZERO_DATE' is deprecated and will be removed in a future release.
[Warning] 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release.

TIMESTAMP with implicit DEFAULT value is deprecated.
在MySQL配置文件my.ini或者my.cnf中的[mysqld]段落中添加一行
explicit_defaults_for_timestamp=true
如果在MySQL配置文件中指定了sql_mode并且使用了ERROR_FOR_DIVISION_BY_ZERO, NO_ZERO_DATE,NO_ZERO_IN_DATE三者中的一个以上,则分别会报出已经不建议使用,以前将移除的错误信息。解决问题的方法,就是将他们全部从sql_mode中去掉。

sql_mode="ONLY_FULL_GROUP_BY,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES"

手机版|轻松E站

GMT+8, 2024/12/22 00:50

快速回复 返回顶部 返回列表