当我尝试启动mySQL服务器时,我收到消息:
[警告]不推荐使用具有隐式DEFAULT值的TIMESTAMP.
请使用--explicit_defaults_for_timestamp服务器选项(有关详细信息,请参阅文档).
我找到答案:http:
//dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_explicit_defaults_for_timestamp
但是如何启用呢?哪里?
gag*_*ine 66
首先,您不需要更改任何内容.
这些非标准行为仍然是TIMESTAMP的默认行为,但是不推荐使用MySQL 5.6.6,并且在启动时会出现此警告
现在,如果您想要转移到新的行为,您必须my.cnf在[mysqld]部分中添加此行.
explicit_defaults_for_timestamp = 1
Run Code Online (Sandbox Code Playgroud)
my.cnf(或其他配置文件)的位置因系统而异.如果找不到,请参考https://dev.mysql.com/doc/refman/5.7/en/option-files.html
Pra*_*nna 14
在您的mysql命令行中执行以下操作:
小智 9
在Windows平台上,
1)找到您的my.ini配置文件.
2)在my.ini中转到[mysqld]部分.
3)添加不带引号的"explicit_defaults_for_timestamp"并保存更改.
4)启动mysqld
这对我有用(Windows 7 Ultimate 32bit)
小智 6
对我来说,它可以在配置文件中添加不带引号的短语“ explicit_defaults_for_timestamp = ON”my.ini。
Make sure you add this phrase right underneath the [mysqld] statement in the config file.
You will find my.ini under C:\ProgramData\MySQL\MySQL Server 5.7 if you had conducted the default installation of MySQL.
| 归档时间: |
|
| 查看次数: |
122326 次 |
| 最近记录: |