Repairing a database
What to do when a table looks corrupted or the application reports a database error.
Errors such as "Table is marked as crashed", "Error establishing a database connection" or "Incorrect key file" sometimes mean a corrupted table. First of all export the database, see Importing and exporting a database.
Repair in cPanel#
- Open Databases → MySQL Databases.
- Near the bottom of the page under Modify Databases choose the database in Check Database and click Check Database.
- If errors are found, choose the same database in Repair Database and click Repair Database.
Repair in phpMyAdmin#
Open the database, tick the tables and from the With selected dropdown choose Repair table. The same dropdown also offers Optimize table for better speed.
If it still does not work#
- Check that the connection details in the configuration are still correct: Connecting to a database from PHP.
- "Error establishing a database connection" often means a wrong password or a changed user, not a corrupted table.
- Restore the database from the last good copy: Restoring from a backup.
If the problem remains, send us a ticket with the exact error text and the database name (without the password).
¿Te ha resultado útil este artículo?
¡Gracias por tu opinión! ¿Necesitas ayuda? Abre un ticket.
Artículos relacionados
phpMyAdminBrowse, edit and search database tables through a web interface.Importing and exporting a databaseHow to back up a database to an .sql file and restore it on a new server.Restoring from a backupHow to restore files and a database from a backup and what to do if you need help.Opening a ticketHow to send a request to support through the ticket system or by email.
