2

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.

4
  • one more note. I do not have my old .ini file where original MySQL config. Commented Aug 18, 2014 at 14:19
  • You can always edit your own question to add clarifications.
    – Vérace
    Commented Aug 18, 2014 at 20:01
  • you don't need the ini file. Is it a standalone DB? What logs do you talk about?
    – ninjabber
    Commented Mar 11, 2016 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
    Commented Mar 11, 2016 at 15:38

2 Answers 2

2
  • 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
0

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 and acknowledge you have read our privacy policy.

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