Trying to solve "outside tablespace bounds" MySQL error, but recovering table with mysqldump fails
Let's elaborate the error message


  InnoDB: Error: trying to access page number 197105 in space 89,


InnoDB calles an .ibd file a "table space" or just "space" in this error message. So, there is a space 89 and one of its pages refers to a non-existing page number 197105. The error message doesn't say what table corresponds to the space 89. I think some MySQL version tell that, but it's possible to find from the InnoDB dictionary.

mysql&gt; select NAME from information_schema.INNODB_SYS_TABLESPACES WHERE SPACE=4304;
+----------------------+
| NAME                 |
+----------------------+
| sakila/film_category |
+----------------------+
1 row in set (0.01 sec)


Now, as we know what table is corrupt the question is how to fix it. InnoDB doesn't heal tablespaces (like MyISAM does with REPAIR TABLE), the only way is to drop the table space(=table) and re-create it.

In this particular case it's not necessary to start MySQL in innodb_force_recovery mode. Just start it normally and drop the table. But first, you probably need to save the data in this table.

There are two ways.
First, you can choose ranges of non-corrupt primary key values and dump them into another table or a text dump. I had recovery cases like this one and wrote a script to do that. The script iterates over the PK ranges and dumps as many records as possible into another (MyISAM) table.

Second way is requires more time and skills. You will need a tool (https://github.com/twindb/undrop-for-innodb) and a blog post https://twindb.com/recover-corrupt-mysql-database/ with steps.

Then drop the corrupted table, create an empty one and load the recovered dump.