Repairing MySQL Database When the Table Gets Crashed – Error 145!
Published by Jacob Martin on May 17, 2014
MyISAM is the default database engine for MySQL which is fast, dependable, simple to use and allows you with full text searching. The MyISAM table provides a wide variety of function for managing the field and indexes. It provides a wide variety of indexing with field management functions. MyISAM has the ability to perform the read operations on database which is known as the main reasons of MySQL and being popular as backend for web applications. But sometimes MyISAM database gets corrupt or damaged due to various reasons. This type of situation occurs because external or internal reasons.
The reason for corruption includes virus infection, power surges, sudden system shutdown when your database is open and many more. When such type of corruption occurs, then MySQL database records can be accessed by restoring the data with the help of an updated backup. But if there is no backup available or backup fails to restore the required records or if you unable to do so then you should use a third party tool so that you can repair the damaged file and it5 should do the needful.
However you can consider a scenario when you come across the error message mentioned below during working in MySQL database table.
“MySQL error code 145= Table was marked as crashed and should be repaired”
However the general cause of for such kind of error message is that the database has got corrupted because there is no space for the database.
Resolution:
- However to solve this kind of problem and to extract the database after the appearance of the above mentioned error message, you can perform the following methods:
- Make a copy of the database
- Discontinue the MySQLD server
- Run myisamchk –r –q to repair the index file and it don’t affect the file. This is used to execute fast recovery of the database.
- No matter if the above steps fails to work, then you can try the myisamchk which is safe recover command. It is also used to carry out a detailed scan and after that it repairs the entire database.
- Still the above steps fails, then you should create a blank data and index files with the help of mentioned commands:
shell> mysql db_name mysql> SET autocommit=1; mysql> TRUNCATE TABLE tbl_name;
mysql> quit
After this copy the old data in a new file. By doing this, the issue should be resolved.
All these methods will help you to solve this problem. But if you are still facing and you are unable to resolve this issue, then the only option is to make use of third party tool so that it can recover MySQL database. Third party tools are non destructive in nature and they do not overwrite the original data during scanning the corrupt database.
You should use MySQL File Repair Tool which is excellent recovery software and which enables you to recover MySQL database. This is used for repairing corrupt MySQL database tables created in MySQL database MyISAM storage engine. This has t6he ability to repair the corrupt database that is created in MySQL 4 .x or 5 .x versions. This software supports Windows server 2000, 2003, 2008, Windows XP, Windows Vista, etc. This repair tool offers user friendly graphical user interface. MySQL File Repair is able to recover several database components like tables, views etc. This repair tool recovers almost all MySQL components like triggers, primary keys and relations.
Steps to fix MySQL Database Error 145
Step 1: Download, install and launch the MySQl Database repair tool.
Step 2: Click ‘Select’ button to find and add corrupt MySQL database to the application and then select OK. Here you have the option of ‘Repair corrupt database which is stored at default location of MySQL’ and ‘Manual option to selct your database from default location’.
Step 3: After the scanning process you can now see the preview of the file in the left panel of the software.
Step 4: Now you can start the reairing process, just click on Repair button. A dialoguie box will appear. Click Yes.
Step 5: After successful completion of the process, a message box is displayed as ‘repair process finished successfully’. Click ‘OK’ to close the message box.
295 Total Views 1 Views Today