Foreign Key Usage and Error Information
You can obtain general information about foreign keys and their usage from querying the INFORMATION_SCHEMA.KEY_COLUMN_USAGE table, and more information more specific to InnoDB tables can be found in the INNODB_SYS_FOREIGN and INNODB_SYS_FOREIGN_COLS tables, also in the INFORMATION_SCHEMA database. See also Section 13.1.17.3, “Using FOREIGN KEY Constraints”.
In addition to SHOW ERRORS, in the event of a foreign key error involving InnoDB tables (usually Error 150 in the MySQL Server), you can obtain a detailed explanation of the most recent InnoDB foreign key error by checking the output of SHOW ENGINE INNODB STATUS.
Firmware recovery
Revisions D1 to D4, H1 as well as I1 are pretty much unbrickable as they have a built-in firmware recovery mode. Revision D5 does not have built in recovery.
To access, simply hold down the reset button while powering on the router. The power LED should blink orange. Set your computer with a static IP in the 192.168.0.x range, and open 192.168.0.1 in a web browser. Recovery mode loads up within a few seconds, but doesn't respond to pings. If the power LED is blinking orange the above page should be accessible.
You will need to flash either a stock firmware image or Openwrt-factory image, *not* a sysupgrade image.