Import SQL File at a specific starting point.

[expired user #9222]'s profile image [expired user #9222] posted 9 years ago in General Permalink
I have a mysql dump file and I renamed it to .sql and I connected to HeidiSQL and did a Import SQL File. Every time I do it, it gets over 50% done and it then it errors with

/* End of file block was cut within some multibyte character, at position 6,186,598,436. Increasing chunk size and retry reading... */

Every time I try it, it always gets stuck at that same spot. The file in question is around 10GB. Is there a way I can start over and skip the records that were already processed, plus skip the record that is causing the failure? I'm ok if I miss a few records, just not 45%+ of the records. The file is so large I can't use any text editor that I have.
ansgar's profile image ansgar posted 9 years ago Permalink
This is a known issue, and one of the most frustrating. I already tried several workarounds, with no luck.

The problem is as follows: A file is read in chunks of 20MB. At some point it finds a critical character which breaks the whole chunk, so it's empty. HeidiSQL tries to reread the 20mb chunk 10 times, each time with 4 more bytes than the previous read, assuming that the very last character in the chunk is broken because the chosen chunk size broke some multi byte character somewhere in the middle. This did solve one or two cases I can recall, but unfortunately not all of them.

Now, what you propose is a broken solution. But anyway not doable - I cannot just not read one character, a whole chunk of 20mb is empty in that case, and that's too much to throw away I think.

I'm just checking if I have a file with which I can reproduce that issue. And then check other methods of file-reading from the net.
ansgar's profile image ansgar posted 9 years ago Permalink
Btw, which HeidiSQL version/revision are you using?
ansgar's profile image ansgar posted 9 years ago Permalink
See also this long thread.
ansgar's profile image ansgar posted 9 years ago Permalink
A good workaround is to just use mysql.exe instead of HeidiSQL to import an .sql file.
[expired user #9222]'s profile image [expired user #9222] posted 9 years ago Permalink
Thanks for the replies. I was using version 9.3.0.4984. A couple weeks ago I could spell MySQL and that was about it. I found out about HeidiSQL on some forums and I'm glad I found it. I was able to import the file using MySQL by using the Workbench. Once that was done I used HeidiSQL to query the database. Thanks again.

Please login to leave a reply, or register at first.