Question

I am currently working on a project that requires a large data migration for a company. We are in the process of planning and testing data imports from an existing Access database to a MySQL database for a CRM they will be using.

We have encountered errors with importing (using Load Data Infile) exported data in .csv format, when the records have accented or special characters due to the files being imported being in ANSI format (the rest of the MySQL database is all in UTF8). I managed to fix this issue by using the Convert to UTF8 functionality in Notepad++, but this was before I knew we needed the existing primary key ID's from the Access database to be imported as well.

Doing this same process with the added ID's causes a MySQL error to throw:

Error Code: 1366. Incorrect integer value: '135' for column 'id' at row 1

Is there a way to convert all this data to UTF8 without having integer values throw errors?

Was it helpful?

Solution

Convert the file to UTF-8 without BOM and try again :)

The trick is that at beginning of the UTF-8 file there is a BOM sequence and your number 135 at the beginning of the file is actually 0xEF 0xBB 0xBF 1 3 5 what causes error in TSV importer unaware of UTF-8.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top