Showing posts with label mysql repair. Show all posts
Showing posts with label mysql repair. Show all posts

Monday, September 22, 2014

Tips to Recover Data from Corrupt MySQL Database

Stellar Repair for MySQL can help in recovery of data from corrupt or damaged MySQL database. In this article I will show how to repair corrupt or damaged MySQL database’ file when it becomes corrupt.

Corruption in MySQL database can happen due to any uncertain reasons. Hardware problem, virus attach, power failure, bugs in MySQL itself, automatic system shutdown are the most common causes for MySQL database corruption. A bad hard drive can write garbage value in the MySQL database and then MySQL reports error messages.

“Cannot load from mysql.proc. The table is probably corrupted”
“MySQL error code 145= Table was marked as crashed and should be repaired”


There are several ways available to recover data from corrupt or damaged MySQL database:

InnoDB Force Recovery

It helps in recovery of data from corrupt MySQL database. By default, 0 is the value of innodb force recovery and database administrator can change it from 1 to 6. A higher value of InnoDB force recovery includes all the functionalities of lower values. For Example, 6 includes all the functionalities of values 5, 4, 3, 2, & 1.

Note: Only use InnoDB force recovery value greater than 0 when there is an emergency situation and make a backup copy of your database before trying it. Backup will help you in recreating the database when needed.

Steps to use InnoDB force recovery:
  • First of all stop MySQL server (mysqld) and copy all the files from /var/lib/mysql.
  • Use innodb-force-recovery to mysqld.
[mysqld]
Innodb_force_recovery=5
  • Start the MySQL server.
  • Dump all the databases.
  • Now restore the database from dump.
Restore from Backup

If the above method does not help then try tested & updated backup. It is the ideal solution to recover database from corrupt database file. Go with the next method, if backup is not available or too old.

Stellar Repair for MySQL

The only remaining method is use Stellar Repair for MySQL software if above solutions fail to restore the database from corrupt MySQL InnoDB database.

Stellar Repair for MySQL is developed by Stellar data recovery and the current version is 6.0. It is available for Windows as well as for Linux but you need to copy your MySQL database from Linux machine to Windows machine and run repair operation over there then after restore the database from Windows machine to Linux machine.
»»  Read More...

Wednesday, February 29, 2012

3 Tweaks that Helped Me TO Recover MySQL Database In Few Hours


When I starts MySQL Server, I am not able to perform any action on it. Like other users, I am also stuck with MySQL Recovery process. But I am not able to understand “what is the reason behind it?” Recently, I made several changes to MySQL database that increased the speed of the database. 


Sometimes MySQL database can become inaccessible because of internal database corruption errors, hardware failure, software failure, power interruptions etc. Each possible database failure error requires a different recovery action. Protect your data against the possibility of data loss by having a well known recovery strategy in place. 


The tips I’m about to give you, it won’t cost you thousands of dollars—in fact, implementing these tips won’t cost you a cent. And they can easily be used by any user. My Guide will help you to recover your MySQL database in few hours. When you will apply any recovery strategy on your database then first check:


  • The database can be in recoverable stage?
  • Mark the time that will be spent to recover your database?
  • Mark the time that spent to performing backup operations?
  • How much storage space can be allocated for backup copies and another files.
  • Will Single table backup be sufficient, or will full MySQL database backups be necessary?


So these are some general terms you should know before performing MySQL Database Recovery 


3 useful tweaks:


Regular schedule for taking database backup:  The concept of a MySQL database is the same as any other database backup. Before taking the backup first shutting down the database to ensure that no further transactions occur, and then simply backing it up. Storing it on a different medium in case of failure or damage to the original. You can then rebuild the database if it becomes damaged or corrupted in some way. Take backup on regular basis to avoid the data loss.


Use Inbuilt Utilities to recover database: The inbuilt utility selection is depend on three terms:

1.Only want to repir MyISAM tables;
2.repair corruption of the other table types;
3.Restore from backup;
If you only want to repair MyISAM tables, use this command:

REPAIR TABLE tablename[,tablename1...] [options];
myisamchk [options] tablename.MYI;

You can use inbuilt MySQL database utilities to repair all corrupt MySQL database tables: 

mysqlcheck [options] dbname tablename [tablename2... ];

or in last you can use restore option to repair MySQL database from the backup. These are some inbuilt utilities examples which you can use to repair MySQL database. 


Commercial Solutions: Third-party recovery software is one another solution to repair corrupt MySQL database & repair all corrupt MySQL database files. The software is build with very advanced technology & work for all MySQL database tables. 


So these are three tweaks to recover MySQL database. If the article helps you to recover your MySQL database, please give your valuable comments..
»»  Read More...