MySQL 5.7 中TIMESTAMP with implicit DEFAULT value is deprecated错误

时间:2024-04-05 11:53:47
MySQL 5.7 中TIMESTAMP with implicit DEFAULT value is deprecated错误


解决方案:

打开my.ini(可用记事本打开),找到“[mysqld]”设置项,添加代码:

#开启查询缓存
explicit_defaults_for_timestamp=true


问题:

D:\software\mysql\mysql-5.7.17-winx64\mysql-5.7.17-winx64\bin>mysqld --initialize
2017-12-13T07:08:35.613357Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-12-13T07:08:35.615357Z 0 [ERROR] -- --initialize specified but the data directory has files in it. Aborting..
2017-12-13T07:08:35.616357Z 0 [ERROR] Aborting

MySQL 5.7 中TIMESTAMP with implicit DEFAULT value is deprecated错误



原因:data文件夹已经存在

MySQL 5.7 中TIMESTAMP with implicit DEFAULT value is deprecated错误


解决办法:删除该bin目录下的该文件夹,删除后重新执行该命令该文件夹会重新生成(如果删除不了可以下载文件粉碎机进行粉碎)

MySQL 5.7 中TIMESTAMP with implicit DEFAULT value is deprecated错误