Mysql – How to restore a MySQL database after formatting the hard drive

MySQLwindows

I recently formatted my PC which had MySQL running on it. As a result, I lost the databases on my hard drive.

I tried to restore the databases by re-installing the MySQL Server and putting the databases back into the MySQL datafiles folder. When I started the MySQL service, I got error 1067: Windows could not start the MySQL Service on local computer.

If I just install MySQL and do not put my databases into the datafiles folder, I don't get the error.

How can I successfully restore my databases?

I'm using Windows Server 2008 R2 enterprise.

Best Answer

After putting the data files, remove ib_logfile0 and ib_logfile1. Dont delete ibdata1 file. And then restart MySQL service.

Before deleting take the backup of ib_logfiles and then delete.

Just give a try in this way.