Hi,
I’m having two problem.
-
IPreformatted text’m trying to restore a database from a backup full, but only me can restore all databases, Can us restore a database?
-
I’m trying to restore a table specific of a database with next comman.
xtrabackup --prepare --export --target-dir=/data/backups/
ALTER TABLE TMP DISCARD TABLESPACE
ALTER TABLE TMP IMPORT TABLESPACE
once the files have been transferred to the mysql directory I cannot recover the data, is there any other way to retrieve only one table?
Regards
1 Like
Hi @Roderick,
Restoring a single table involves these steps:
- xtrabackup --prepare --export --target-dir=/data/backups/
- CREATE DATABASE restore;
- CREATE TABLE restore.comman LIKE orig.comman;
- ALTER TABLE restore.comman DISCARD TABLESPACE;
- cp /data/backups/orig/comman.* /var/lib/mysql/restore/
- chown mysql:mysql /var/lib/mysql/restore/comman.*
- ALTER TABLE restore.comman IMPORT TABLESPACE;
2 Likes
Hi @matthewb
Thanks for support, perform the restore of database with the tables of way correctly.
Regards
1 Like
I would say your backup is not accurate. You changed the schema after taking the backup. After you CREATE TABLE … LIKE …, drrop the new index before importing tablespace.
3 Likes
Hi @matthewb
Thanks, if you had a problem with the indexes but the table structure was recreated and it worked correctly.
Regards
1 Like