Primary hard disk where MySQL (version 5.1) was installed is crashed and I had to re install entire OS. I have all the files including ibdata1 file. How do I go about recreating and attaching database to restore it to stage where it was crashed. Do i need log files or I can delete them ?. I am OK if some of the data I cannot restore. Important is I have all tables and most of the data possible.

  • one more note. I do not have my old .ini file where original MySQL config. – Lord OfTheRing Aug 18 '14 at 14:19
  • You can always edit your own question to add clarifications. – Vérace Aug 18 '14 at 20:01
  • you don't need the ini file. Is it a standalone DB? What logs do you talk about? – ninjabber Mar 11 '16 at 15:11
  • also what type of engine was the database using. If you were using myisam in all the tables then you need the MYD MYI and FRM files and you will suceed. If you were using innodb you need all the ibdata and iblog files and pray a little for luck – PerroVerd Mar 11 '16 at 15:38
  • install the new MySQL
  • create the db you want, let's say DB_NAME_RESTORE
  • go to /var/lib/DB_NAME_RESTORE and copy the data files there
  • chmod on the files if you have to

You will need to install a fresh copy of MySQL and drop the raw data files into the new installation's Data Root, and then start the MySQL service.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.