From what I am seeing with innobackex and backing up a single database, there doesn’t seem to be a way to restore this database backup.
My use case is to copy one database from server1 to server 2. Here is what I’ve tried.
Run backup from server1
innobackupex --user=backup --password=* --stream=tar --database=test ./ | ssh server2 \ "cat - /data/backups/test.tar
After the backup completed, I un-tarred it and prepared it
innobackupex --apply-log /data/backups
I shutdown mysql on server2 and copied the /data/backups/test directory to /data/mysql
cp -r /data/backups/test /data/mysql/test
I then started mysql and logged in
I can see the table in the test database but I am unable to select from it.
select * from test.junk;
Error 1146 (42S02): Table ‘test.junk’ doesn’t exist
InnoDB: Cannot open table test/junk from the internal data dictionary of InnoDB though the .frm file for the table exists
I’ve tried deleting the ibdata1 file as I’ve seen in some places but I can’t seem to get the junk table to register to the data dictionary if you will.
I’m a little surprised there are no examples of DB restores. I’ve seen table restore examples. Am I understanding what the --databases option is for?