Search code examples
mysqldatabasephpmyadminmampdatabase-restore

How to restore database in MySQL/phpMyAdmin?


I was using the MAMP program to host my database locally on my laptop. I had a problem so I had to reinstall the MAMP software. Before I did that though, I copied my entire MAMP folder from my C drive to my desktop. Now that I have MAMP installed, I opened the startpage and then went to phpMyAdmin.

I want to know how I can restore my database? When I opened phpMyAdmin after reinstallation, I could see the database and the name of the tables. But when I click on the tables, it says the table doesn't exist. When I tried importing the table, there was an error and it didn't work. Here is a screenshot of the error:

MySQL Error

The copied database is in this location: C:\Users\MyUserName\Desktop\MAMP\db\mysql\DatabaseName. In the DatabaseName folder, there are the 3 tables which I had which have the .frm file extension. and then 1 file called db.opt. How can I restore the tables to my database?

Thanks in advance


Solution

  • Here is a solution. It works very well.

    You just need to copy the ib_LogFiles and the ibData file and it should all be fixed!

    https://stackoverflow.com/a/10943833/6183565