Play this article
I am sharing this experience and recovery option because i faced this issue while one IT person destroy EC2 instance but luckily he forgot to delete volume used for EC2. I am able to restore required MySql Databases.
Here are the steps for restoring an InnoDB MySQL Database on Ubuntu 12.04:
- Shut down the mysql service (sudo service mysql stop)
- Copy the database folder that contains the
.frm
files to/var/lib/mysql/[DBNAME]
. As far as I know, this folder must be the same name as the old database. - Copy the
ibdata1
file from your old server to/var/lib/mysql/ibdata1
- *THIS IS IMPORTANT. Make sure the permissions of the files are correct.I simply did
sudo chmod -R 777 /var/lib/mysql
.
Note : This is not recommended if your server is a production server. - Start the mysql service (
sudo service mysql start
)