1

I'm trying to move my website from my old server to the new server at Vultr.

However, while importing the database I encountered a very annoying issue, which I spent and hours on and still couldn't fix it.

The error is happening due to the DateTime which I think needs to be converted to timestamp, however, the database is too large to be converted one by one.

Here is the error anyway:

Error at the line 111680: ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 
COLLATE=utf8mb4_unicode_ci;
Query: --
--
CREATE TABLE `mvmnvu_links` (
`link_id` bigint(20) UNSIGNED NOT NULL,
`link_url` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`link_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`link_image` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`link_target` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`link_description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 
'',
`link_visible` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Y',
`link_owner` bigint(20) UNSIGNED NOT NULL DEFAULT '1',
`link_rating` int(11) NOT NULL DEFAULT '0',
`link_updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`link_rel` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`link_notes` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
`link_rss` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
MySQL: Invalid default value for 'link_updated'
Stopped on error

Any quick solutions for this?

Thank you.

  • Google keywords: mysql sql_mode date default value – marekful Nov 02 '17 at 03:54
  • 1
    Possible duplicate of [Error in mysql when setting default value for DATE or DATETIME](https://stackoverflow.com/questions/36374335/error-in-mysql-when-setting-default-value-for-date-or-datetime) – marekful Nov 02 '17 at 03:55

0 Answers0