In this tutorial we’ll cover how to use MySQLcheck to repair a corrupted database table.
Repairing a Corrupted MySQL Database Table
Please refer to the following steps:
- First, log in to your MySQL server using Secure Shell (SSH).
- Then, enter the following command at root prompt:
mysqlcheck -r [database name]
Where, mysqlcheck is the command to check the database, -r is the command to repair the corrupted tables. Replace the [database name] with your actual database name.
Please note that MyISAM is a default storage engine of MySQL, unless you change it. Mostly MyISAM is set as default engine to check and repair all the tables in the mysql database.
If the above doesn’t work, then you can try the following commands via the Linux shell prompt.
myisamchk -r /var/lib/mysql/[database name]/*
Where, myisamchk is a command to check mysql database and -r is a command to repair the corrupted tables.
- View the Contents of a Table in a SQL Server Database Using Enterprise Manager
- Create a MySQL Backup from Command Line – MySQL Import SQL File
- How to Install SQL Server 2012 Express on Windows Server 2012
Don’t see what you’re looking for? Use the search bar at the top to search our entire Knowledge Base.
The Hivelocity Difference
With best-in-class customer service, affordable pricing, a wide-range of fully-customizable options, and a network like no other, Hivelocity is the hosting solution you’ve been waiting for.