如何启用explicit_defaults_for_timestamp? [英] How to enable explicit_defaults_for_timestamp?
问题描述
当我尝试启动mySQL服务器时,我收到消息:
When I try to start my mySQL server I get message:
[警告]不建议使用具有隐式DEFAULT值的TIMESTAMP.
请使用--explicit_defaults_for_timestamp服务器选项(请参阅 文档以获取更多详细信息.
[Warning] TIMESTAMP with implicit DEFAULT value is deprecated.
Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
我在以下位置找到答案:
http://dev.mysql.com/doc /refman/5.6/en/server-system-variables.html#sysvar_explicit_defaults_for_timestamp
I find answer on:
http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_explicit_defaults_for_timestamp
但是如何启用它?在哪里?
But how to enable it? Where?
推荐答案
首先,您不需要进行任何更改.
First you don't need to change anything yet.
这些非标准行为仍然是TIMESTAMP的默认行为,但截至 不建议使用MySQL 5.6.6,并在启动时显示此警告
Those nonstandard behaviors remain the default for TIMESTAMP but as of MySQL 5.6.6 are deprecated and this warning appears at startup
现在,如果您要转到新行为,您必须在[mysqld]部分的my.cnf
中添加此行.
Now if you want to move to new behaviors you have to add this line in your my.cnf
in the [mysqld] section.
explicit_defaults_for_timestamp = 1
my.cnf(或其他配置文件)的位置因一个系统而异.如果找不到,请参考 https://dev. mysql.com/doc/refman/5.7/en/option-files.html
The location of my.cnf (or other config files) vary from one system to another. If you can't find it refer to https://dev.mysql.com/doc/refman/5.7/en/option-files.html
这篇关于如何启用explicit_defaults_for_timestamp?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!