I am using MySQL 5.1.68. Recently a table of my database has been corrupted due to improper input. I have tried to dump the table and change the innodb_force_recovery but none of them worked. The table indices are not corrupted. The problem occurred at a string column where ',' characters has been input. I know the row where the corruption has started and I do not care if data from that row and below will be deleted. Can I manually delete those records from the ibdata file? is there another approach?
You can use mysqldump to dump part of a table. For example, if you want to dump rows of table foo
up to primary key value 1234 but no further:
$ mysqldump mydatabase foo --where "id <= 1234" > foo-dump.sql
Then drop table foo, hoping that removes the corruption. Then restore the dump file.
Comment from @akuzmisnky is correct (he's a colleague of mine at Percona, and he's one of the most experienced experts on MySQL data recovery in the world).
Here's the sequence of actions he is referring to, in more detail:
rm
the InnoDB tablespaces and log files.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.