This page looks best with JavaScript enabled

Mysql database corruption!

 ·   ·  ☕ 3 min read

Mysql is very popular for web application and acts as a database component of the LAMP, SAMP, MAMP, BAMP and WAMP platforms (linux/mac/solaris/windows-apache-Mysql-php/perl/python). The file format that mysql uses to store the data has been widely tested but there are always external conditions that sometimes cause database tables to become corrupted. Mysql database is known for its stability but like as many other software there might be bugs which could crash the mysql tables.

When your database starts misbehaving all of a sudden, it is possible that you may have a database or table corruption.

Reasons for Mysql database corruption are as follows-

1. In the middle of the write mysqlId process have been killed.

2. Software bug in the MyISAM code and Mysql.

3. On a live table if you are using an external program like myisamchk.

4. Hardware error like faulty cpu/motherboard/memory.

5. Suddenly the computer is turned off or accidentally shut down of computer.

6. Virus infection.

7. Corruption in “.myd” and “.myi” files.

8. Error in configuring the connection with the database provider.

Symptoms of Mysql database corruption are as follows-

When you get error messages like the following-

1. Record file has been crashed.

2. Unexpected end of file.

3. ‘tbl_name.frm’ has been locked against change.

4. Unable to find file ‘tbl_name.MYI’ (Errcode :###)

5. Incorrect key file for the table.

6. From the table handler got error ###.

Where ### refers to Mysql error codes which returns an error number like-

126: index file is crashed/incorrect file format.

127: Record file is crashed.

132: Old database file.

134: Record was already deleted.

135: No more room in record file.

136: No more room in index file.

141: Duplicate unique key or constraint on update or write.

144: Table is crashed and last repair failed.

145: Tables marked as crashed and should be repaired.

In the situation of database corruption you can use or try some of the listed steps of repairing the database-

1. Remove and prevent all users from accessing the database.

2. Shut down the database server.

3. Create a back up of the existing database.

4. Use the utility of database to check for database corruptions.

5. Repair if any damaged database tables.

6. Check database for corruption again.

7. Restart database server and remove that back up that you created above.

There are many software that recovers the lost mysql database components. They provides absolute recovery of Mysql database components including primary keys, tables and relations as well as it can also recover views and triggers as queries. You can download the free trial versions of the software from online to scan your drive to recover your lost data. Buy the software online and complete your Mysql recovery.

Share on