Sometimes it happens that your Magento database is broken or corrupt. This can be caused by various reasons such as hacking or server crash. When the database is broken and you have to fix it, the database repair tool from Magento is of great help.
In this recipe, we will make our database corrupt and fix it with the repair tool.
To prepare you, download the database repair tool from the Magento site at http://www.magentocommerce.com and place the PHP file in your server root.
The following steps show you how to make your database corrupt and fix it using the database repair tool:
Create a backup of your existing database.
Create an empty database as the reference database. Let's say we call it
magento_dev_repair
.Configure Magento to use this database in the
app/etc/local.xml
file.Clear the cache and run Magento. This will install an empty Magento in this database.
Make your original database corrupt. You can do this by running the following queries...