# use innobackupex to backup a specific database

**URL:** <https://forums.percona.com/t/use-innobackupex-to-backup-a-specific-database/4878>\
**Category:** Percona XtraBackup\
**Created:** [May 5, 2016, 1:41am UTC](https://forums.percona.com/t/use-innobackupex-to-backup-a-specific-database/4878 "2016-05-05T01:41:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zuoruochen](https://avatars.discourse-cdn.com/v4/letter/z/7ea924/32.png) [@zuoruochen](https://forums.percona.com/u/zuoruochen)\
**Post date:** [May 5, 2016, 1:41am UTC](https://forums.percona.com/t/use-innobackupex-to-backup-a-specific-database/4878/1 "2016-05-05T01:41:56Z")

</div>

I want to create a slave to sync a specific database which is used to read. So i use innobackupex to backup the database and use it to init my slave.  
i use the command

```auto
innobackupex --user=xxx --password=xxx --databases=rpt_version /mnt/bak

```

and completed ok. However when i in apply-log stage,it come to some error but it also print completed ok at the last.  
The apply command is

```auto
innobackupex --user=xxx --password=xxx --databases=rpt_version --apply-log /mnt/bak

```

.  
The output of

```auto
xtrabackup --print-defatlts

```

is  
[HTML] --log-error=/var/log/mysql/error.log --log-output=FILE --general\_log=0 --general\_log\_file=/infobright\_datadir/datadir\_new/general\_query.log --slow\_query\_log=1 --long\_query\_time=5 --slow\_query\_log\_file=/infobright\_datadir/datadir\_new/slow\_query.log --log\_error\_verbosity=2 --server-id=1 --binlog\_format=ROW --log-bin=/infobright\_datadir/datadir\_new/mysql-bin.log --binlog\_do\_db=dj\_version --binlog\_do\_db=out\_version --binlog\_do\_db=rpt\_version --expire\_logs\_days=7 --collation-server=utf8\_unicode\_ci --init-connect=SET NAMES utf8 --character-set-server=utf8 --secure-file-priv= --sql\_mode=ONLY\_FULL\_GROUP\_BY,STRICT\_TRANS\_TABLES,ERROR\_FOR\_DIVISION\_BY\_ZERO,NO\_AUTO\_CREATE\_USER,NO\_ENGINE\_SUBSTITUTION --symbolic-links=0 --innodb\_buffer\_pool\_size=2048M --innodb\_read\_io\_threads=20 --query\_cache\_size=128M --tmp\_table\_size=128M --key\_buffer\_size=128M --max\_allowed\_packet=256M --innodb\_file\_per\_table=1 --innodb\_data\_home\_dir=/infobright\_datadir/datadir\_new --innodb\_log\_group\_home\_dir=/infobright\_datadir/datadir\_new [/HTML]  
and the output of apply-log stage :  
[HTML] 160505 14:34:04 innobackupex: Starting the apply-log operation IMPORTANT: Please check that the apply-log run completes successfully. At the end of a successful apply-log run innobackupex prints “completed OK!”. innobackupex version 2.4.2 based on MySQL server 5.7.11 Linux (x86\_64) (revision id: 8e86a84) xtrabackup: cd to /infobright\_datadir/bak/2016-05-05\_12-26-48 xtrabackup: This target seems to be already prepared. InnoDB: Number of pools: 1 xtrabackup: notice: xtrabackup\_logfile was already used to ‘–prepare’. xtrabackup: using the following InnoDB configuration for recovery: xtrabackup: innodb\_data\_home\_dir = . xtrabackup: innodb\_data\_file\_path = ibdata1:12M:autoextend xtrabackup: innodb\_log\_group\_home\_dir = . xtrabackup: innodb\_log\_files\_in\_group = 2 xtrabackup: innodb\_log\_file\_size = 50331648 xtrabackup: using the following InnoDB configuration for recovery: xtrabackup: innodb\_data\_home\_dir = . xtrabackup: innodb\_data\_file\_path = ibdata1:12M:autoextend xtrabackup: innodb\_log\_group\_home\_dir = . xtrabackup: innodb\_log\_files\_in\_group = 2 xtrabackup: innodb\_log\_file\_size = 50331648 xtrabackup: Starting InnoDB instance for recovery. xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter) InnoDB: PUNCH HOLE support available InnoDB: Mutexes and rw\_locks use GCC atomic builtins InnoDB: Uses event mutexes InnoDB: GCC builtin \_\_sync\_synchronize() is used for memory barrier InnoDB: Compressed tables use zlib 1.2.3.4 InnoDB: Number of pools: 1 InnoDB: Using CPU crc32 instructions InnoDB: Initializing buffer pool, total size = 100M, instances = 1, chunk size = 100M InnoDB: Completed initialization of buffer pool InnoDB: page\_cleaner coordinator priority: -20 InnoDB: Highest supported file format is Barracuda. InnoDB: Removed temporary tablespace data file: “ibtmp1” InnoDB: Creating shared tablespace for temporary tables InnoDB: Setting file ‘./ibtmp1’ size to 12 MB. Physically writing the file full; Please wait … InnoDB: File ‘./ibtmp1’ size is now 12 MB. InnoDB: 96 redo rollback segment(s) found. 1 redo rollback segment(s) are active. InnoDB: 32 non-redo rollback segment(s) are active. InnoDB: 5.7.11 started; log sequence number 1301619091050 InnoDB: Failed to find tablespace for table `mysql`.`innodb_table_stats` in the cache. Attempting to load the tablespace with space id 321 InnoDB: Operating system error number 2 in a file operation. InnoDB: The error means the system cannot find the path specified. InnoDB: Cannot open datafile for read-only: ‘./mysql/innodb\_table\_stats.ibd’ OS error: 71 InnoDB: Operating system error number 2 in a file operation. InnoDB: The error means the system cannot find the path specified. InnoDB: Could not find a valid tablespace file for `mysql/innodb_table_stats`. Please refer to [MySQL :: MySQL 5.7 Reference Manual :: 14.22.3 Troubleshooting InnoDB Data Dictionary Operations](http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html) for how to resolve the issue. InnoDB: Failed to find tablespace for table `mysql`.`innodb_index_stats` in the cache. Attempting to load the tablespace with space id 320 InnoDB: Operating system error number 2 in a file operation. InnoDB: The error means the system cannot find the path specified. InnoDB: Cannot open datafile for read-only: ‘./mysql/innodb\_index\_stats.ibd’ OS error: 71 InnoDB: Operating system error number 2 in a file operation. InnoDB: The error means the system cannot find the path specified. InnoDB: Could not find a valid tablespace file for `mysql/innodb_index_stats`. Please refer to [MySQL :: MySQL 5.7 Reference Manual :: 14.22.3 Troubleshooting InnoDB Data Dictionary Operations](http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html) for how to resolve the issue. InnoDB: xtrabackup: Last MySQL binlog file position 8202245, file name mysql-bin.000122 xtrabackup: starting shutdown with innodb\_fast\_shutdown = 1 InnoDB: FTS optimize thread exiting. InnoDB: Starting shutdown… InnoDB: Shutdown completed; log sequence number 1301619092641 InnoDB: Number of pools: 1 xtrabackup: using the following InnoDB configuration for recovery: xtrabackup: innodb\_data\_home\_dir = . xtrabackup: innodb\_data\_file\_path = ibdata1:12M:autoextend xtrabackup: innodb\_log\_group\_home\_dir = . xtrabackup: innodb\_log\_files\_in\_group = 2 xtrabackup: innodb\_log\_file\_size = 50331648 InnoDB: PUNCH HOLE support available InnoDB: Mutexes and rw\_locks use GCC atomic builtins InnoDB: Uses event mutexes InnoDB: GCC builtin \_\_sync\_synchronize() is used for memory barrier InnoDB: Compressed tables use zlib 1.2.3.4 InnoDB: Number of pools: 1 InnoDB: Using CPU crc32 instructions InnoDB: Initializing buffer pool, total size = 100M, instances = 1, chunk size = 100M InnoDB: Completed initialization of buffer pool InnoDB: page\_cleaner coordinator priority: -20 InnoDB: Highest supported file format is Barracuda. InnoDB: Removed temporary tablespace data file: “ibtmp1” InnoDB: Creating shared tablespace for temporary tables InnoDB: Setting file ‘./ibtmp1’ size to 12 MB. Physically writing the file full; Please wait … InnoDB: File ‘./ibtmp1’ size is now 12 MB. InnoDB: 96 redo rollback segment(s) found. 1 redo rollback segment(s) are active. InnoDB: 32 non-redo rollback segment(s) are active. InnoDB: 5.7.11 started; log sequence number 1301619092641 xtrabackup: starting shutdown with innodb\_fast\_shutdown = 1 InnoDB: FTS optimize thread exiting. InnoDB: Starting shutdown… InnoDB: Failed to find tablespace for table `mysql`.`innodb_index_stats` in the cache. Attempting to load the tablespace with space id 320 InnoDB: Operating system error number 2 in a file operation. InnoDB: The error means the system cannot find the path specified. InnoDB: Cannot open datafile for read-only: ‘./mysql/innodb\_index\_stats.ibd’ OS error: 71 InnoDB: Operating system error number 2 in a file operation. InnoDB: The error means the system cannot find the path specified. InnoDB: Could not find a valid tablespace file for `mysql/innodb_index_stats`. Please refer to [MySQL :: MySQL 5.7 Reference Manual :: 14.22.3 Troubleshooting InnoDB Data Dictionary Operations](http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html) for how to resolve the issue. InnoDB: Failed to find tablespace for table `mysql`.`innodb_table_stats` in the cache. Attempting to load the tablespace with space id 321 InnoDB: Operating system error number 2 in a file operation. InnoDB: The error means the system cannot find the path specified. InnoDB: Cannot open datafile for read-only: ‘./mysql/innodb\_table\_stats.ibd’ OS error: 71 InnoDB: Operating system error number 2 in a file operation. InnoDB: The error means the system cannot find the path specified. InnoDB: Could not find a valid tablespace file for `mysql/innodb_table_stats`. Please refer to [MySQL :: MySQL 5.7 Reference Manual :: 14.22.3 Troubleshooting InnoDB Data Dictionary Operations](http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html) for how to resolve the issue. InnoDB: Shutdown completed; log sequence number 1301619094187 160505 14:34:08 completed OK!  
[/HTML]

---

<div class="post-metadata">

**Author:** ![zuoruochen](https://avatars.discourse-cdn.com/v4/letter/z/7ea924/32.png) [@zuoruochen](https://forums.percona.com/u/zuoruochen)\
**Post date:** [May 5, 2016, 1:46am UTC](https://forums.percona.com/t/use-innobackupex-to-backup-a-specific-database/4878/2 "2016-05-05T01:46:35Z")

</div>

the Mysql server is 5.7.10.
