Posted by & filed under Server Admin, Web Development.

Ran into a issue where I wanted to do a mysqldump of a database in order to transfer it to a new server.

mysqldump -u user -p shoppingcart > sqloutput.sql 

This failed saying that three of the tables were corrupted. I ran the mysqlcheck utility to see if it could be repaired:

mysqlcheck -u user -p shoppingcart

It outputted the following errors among checking the rest of the tables successfully:

shoppingcart.isc_coupon_locations
Error    : Table 'shoppingcart.isc_coupon_locations' doesn't exist
error    : Corrupt
shoppingcart.isc_coupon_shipping_methods
Error    : Table 'shoppingcart.isc_coupon_shipping_methods' doesn't exist
error    : Corrupt
shoppingcart.isc_coupon_usages
Error    : Table 'shoppingcart.isc_coupon_usages' doesn't exist
error    : Corrupt

I was strongly suspecting that these tables were old remnants of a old software version or something along those lines.

I tried to re-run the command, telling it to repair the tables. It kicked out the same errors about the tables not being found.

mysqlcheck -u user -p shoppingcart --auto-repair --check --optimize --databases

Went ahead and issues a drop command for the three tables, as I suspect this is unused and leftover from a previous upgrade.

mysql -u user -p 
mysql> use shoppingcart;
mysql> drop table isc_coupon_locations;
mysql> drop table isc_coupon_shipping_methods;
mysql> drop table isc_coupon_usages;

After each of the drop statements, MySQL reported a error that it was unable to delete as it could not find the table. I re-ran mysqlcheck and found that it actually did remove them, and it reported no issues. I was then able to go ahead and re-run my mysqldump command and completed extracting the database.

Leave a Reply

You must be logged in to post a comment.