VM backup uses Mysql in the backend. Why we choose Mysql is due to its performance and its ability to withstand more load as all of us know that Mysql is an open source and it is a relational Database Management.

There are some cases where Mysql service fails to start. In these cases, access the err file extension located in the data directory location C:\Program Files\MySQL\MySQL Server 5.1\Data\data and if it has the word corrupted, then follow the Steps to find out where mysql has gone wrong and try to recover it.

Protect Your Data with BDRSuite

Cost-Effective Backup Solution for VMs, Servers, Endpoints, Cloud VMs & SaaS applications. Supports On-Premise, Remote, Hybrid and Cloud Backup, including Disaster Recovery, Ransomware Defense & more!

Step 1:

Recovery Mode

This would help to recover the Mysql without minimal down time.

Download Banner

(i) Add the line force_innodb_recovery=4 under the server section in the my.ini file found in the location C:\Program Files\MySQL\MySQL Server 5.1.

SERVER SECTION
# ———————————————————————-
#
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this
# file.
#

[mysqld]

# The TCP/IP Port the MySQL Server will listen on
port=3306
force_innodb_recovery=4

Once the line is added, you need to rename the ib_logfile0&ib_logfile1 found in the mysql data directory folder C:\Program Files\MySQL\MySQL Server 5.1\Data\data and then proceed starting the Mysql service.

mysqld_safe –user=root &

If it fails, then try adding force_innodb_recovery=5 & also force_innodb_recovery=6 if necessary. These are the safe mode option to recover the databases.

Note: If all the option fails you need to use the dump available in the storage location. If the above method works then move to step 3.

Step 2:

Integrity check (Mysqlcheck)

(ii) This step is an Integrity check which is used to find out the corrupted database.

mysqlcheck –all-databases -uroot -p admin

(i) If mysqlcheck fails, then get the last database name shown in the command prompt.

Please rename the corrupted database from the data directory location ( C:\Program Files\MySQL\MySQL Server 5.1\Data\data) of the mysql. Then do the mysql check again.

(ii) If mysqlcheck is success, get the shard name of the backup name which is failed. Do the checkandupdateDB process for the backup once you are able to login to mysql.

Step3:

Dumping of databases

Note :If the mysql is started using recovery mode and mysqlcheck get succeeded

Dump the mysql database using the command

mysqldump –all-databases -uroot -p admin > alldump.sql.

It can be runned from anywhere.

If it finishes successfully,

Now uninstall and reinstall the MySQL.Then import the dump file using the steps

mysql -uroot -padmin

This would help to rebuild the mysql easily without any data loss.

Go questions? Email us at: vembu-support@vembu.com for answers.

Follow our Twitter and Facebook feeds for new releases, updates, insightful posts and more.

Rate this post