最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

date time - Trying to change database tables storage engine to innodb gives error "invalid default value for 'p

programmeradmin3浏览0评论

I have a live WordPress website. Most of the tables are using MyISAM storage engine with UTF-8 encoding. I need to switch their storage engine to innodb. But when I try to change the engine, I get errors like invalid default value for 'post_date' & invalid default value for 'user_registered'.

I can see other related(but not similar) issues says that I should

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";

While others say I should

SET SQL_MODE='ALLOW_INVALID_DATES';

How can I skip the issue that datetime columns are showing invalid default value for 'COL_NAME' issue? Is it safe if I changed the datetime format and allowed invalid dates? Will that make errors in WordPress?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论