Hello stackoverflow! First time poster here. I'm having problems re-importing a database dump made by mysqldump. I ran mysqldump with the order-by-primary option, and I had it run on a table with a unique key (and no explicit primary key, so it sorted by that unique key). My objective in this case was to re-create the table, making the unique key into the primary key.
This dump took a very long time (around 10 days) and it would be a major pain in the ass to run it again. I tried reimporting the dump (with the appropriate schema changes), but mysql choked midway through. I looked in the dumpfile, at the place where it choked - and it looks like someone inserted a spam email right into the text of the dumpfile.
Fortunately, it looks like the damage was isolated, I'm able to see the key right before the garbage, and right after.
tl;dr: if I just spliced out the garbage, I dont know how many keys will be missing between the one before and the one after - the dump is sorted by that unique key, so it makes life easier in that respect. Does mysql have a way to retrieve all rows between two entries in an index?
The key is a 32-character hex string, stored in a CHAR(32) type column. I'm pretty sure I can't use the < or > operators on strings... so any suggestions?