'colValue' can't have a default value

2 posts by 2 authors in: Forums > CMS Builder
Last Post: September 8, 2022   (RSS)

By daniel - September 8, 2022

Hi petrogus,

It can be difficult to tell the exact issue without seeing the backup file itself, but something that we've found in the past is that sometimes fields will end up with a default value of the string "NULL" rather than the NULL value. This is acceptable in MariaDB but causes an error when moving to MySQL, because MySQL doesn't support default values in mediumtext fields.

If you open your backup file in a text editor and search for "colValues" you should see something like this:

`colValues` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT 'NULL',

If there are quotations around 'NULL'  like the above (or any other value other than just NULL) it needs to be modified to:

`colValues` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,

It's likely that this isn't the only field where this is an issue, and they will all need to be corrected, though using a simple search/replace can take care of this relatively quickly.

Let me know if this helps, or if you have any other questions!

Thanks,

Daniel
Technical Lead
interactivetools.com