I have an unsanitized data source that I don't control and is hundreds of GB in size with fixed width columns. When I run
LOAD DATA LOCAL INFILE
'B:\\path\\data.txt' IGNORE
INTO TABLE `bigtable`
(@row)
SET
field1 = TRIM(SUBSTR(@row,1,12)),
field2 = TRIM(SUBSTR(@row,13,192)),
field3 = TRIM(SUBSTR(@row,205,1)),
90+ more row.....
it won't import a single record on account of Invalid utf8 character string: 'L15000156741CHAMPION FITNESS, LLC
There doesn't look to be anything wrong with the string. There are no special characters. ASCII and utf8 overlap in this range right? This LOAD DATA
statement would work in previous versions of MySQL but in version 5.7.19 it's not working and it's driving me up a wall. I don't need to keep the broken rows. None of the other answers have solved the situation for me including here and here.
Is there some way to simply skip the broken rows? Maybe a setting or statement I'm forgetting? I thought IGNORE
should have fixed this but it still won't load.