We are currently trying to import some old historic data tables. Unfortunately, the data is in exported tablespace files (.ibd and .cfg) - there are no dump files available and the server they came from no longer exists.
There are separate tables for each month of data, but they should all have exactly the same format. We have successfully imported the more recent files (with e.g. ALTER TABLE sqlt_data_1_2017_01 IMPORT TABLESPACE
), but all the remaining idb files are failing with the following error:
SQL Error [1808] [HY000]: Schema mismatch (Column datevalue length mismatch.)
The datevalue column is a DATETIME.
It's possible that different versions of MySQL were used for creating the various tables and also for exporting the table spaces, but we are 99% sure that the starting version was 5.7.
Some of the tables have .frm
files, so we compared a few with mysqlfrm --vvv -diagnostic
and noticed that some of the datevalue columns have field_length 26 and some have field_length 19. Also, the stringvalue is VARCHAR(255) but the field_length is 762, although I suspect this is because it's in UTF8.
- All the tables we can import have MYSQL_VERSION_ID 50722 and datevalue field_length 19
- All the tables we can't import have MYSQL_VERSION_ID 50714 and datevalue field_length 26
Did something change with the DATETIME storage format at some point? What can we do to import these tables?
Thanks.