Repairing the database
Sometimes, it can happen that your Magento database is broken or corrupt. This can be caused by various reasons such as a hack or a server crash. When the database is broken, everyone wants to repair it as quickly as possible.
Common examples of a corrupt database are missing tables or columns after running an unsaved query, or missing relations after an import of a dump without the relations.
Magento has a database repair tool that compares database A with database B and this tool can fix the missing structures between them.
In this recipe, we will make our database corrupt and we will repair it with the repair tool.
Getting ready
To prepare yourselves, download the database repair tool from the Magento site at http://www.magentocommerce.com and place the PHP file in your webroot.
How to do it...
The next steps show you how you can break your database and how to fix it using the database repair tool:
Create a backup of your existing Magento 2 database.
Create a new empty database...