摘要:本文主要记录了在使用MySQL的过程当中遇到的问题以及解决方案。mysql
1 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
在配置文件中加入:sql
1 [mysqld] 2 # explicit_defaults_for_timestamp 3 explicit_defaults_for_timestamp=true
MySQL5.6.6之前:ide
若是timestamp类型的列指定值为null,默认为当前timestamp。spa
若是timestamp类型的列没有指定值为null,也就是没有传值,默认为非null的一个值。rest
表中第一个timestamp列,若是没有指定值为null、也没有设置默认值,在插入和更新时都会设置为当前时间。日志
表中第一个timestamp列以后的全部timestamp列,若是没有被定义为null、定义default值,会设置为'0000-00-00 00:00:00'。code
MySQL5.6.6之后,须要在配置文件里设置 explicit_defaults_for_timestamp=true ,其含义为:server
若是timestamp类型的列指定值为null,默认为当前timestamp。blog
若是timestamp类型的列没有指定值为null,也就是没有传值,默认为null。ci
声明timestamp类型的列不为能为null,并且没有指定默认值。在插入时timestamp类型的列没有指定值,若是是严格sql模式,会抛出一个错误,若是严格sql模式没有启用,该列会赋值为‘0000-00-00 00:00:00’,同时出现警告。
1 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled. 2 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path. 3 [ERROR] Failed to access directory for --secure-file-priv. Please make sure that directory exists and is accessible by MySQL Server.
在配置文件中加入:
1 [mysqld] 2 # 设置导入导出 3 secure-file-priv=D:\All\MySQL\file
配置文件里的 secure-file-priv 参数是用来限制将数据导入导出到指定目录的:
当值为null,表示不容许导入导出操做。
当值为具体的文件夹,表示导入导出只能在该目录下操做,目录不存在会报错。
当值没有具体值时,表示不限制导入导出操做的文件夹。