使用 XtraBackup 进行MySQL数据库物理备份(12)

[root@localhost mysql]# ls -l
total 176164
drwx------ 2 root  root      4096 Nov  6 11:07 aazj
-rw-rw---- 1 mysql mysql      543 Nov  6 11:13 general.log
-rw-r----- 1 root  root  79691776 Nov  6 11:07 ibdata1
-rw-r----- 1 root  root  50331648 Nov  6 11:07 ib_logfile0
-rw-r----- 1 root  root  50331648 Nov  6 11:07 ib_logfile1
-rw-rw---- 1 mysql mysql      543 Nov  6 11:13 localhost-slow.log
drwx------ 2 root  root      4096 Nov  6 11:07 mysql
-rw-rw---- 1 mysql mysql        0 Nov  6 11:12 mysql-bin.index
drwx------ 2 root  root      4096 Nov  6 11:07 performance_schema
drwx------ 2 root  root      4096 Nov  6 11:07 t
-rw-r----- 1 root  root        24 Nov  6 11:07 xtrabackup_binlog_pos_innodb
-rw-r----- 1 root  root      487 Nov  6 11:07 xtrabackup_info
[root@localhost mysql]# chown -R mysql:mysql /var/lib/mysql
[root@localhost mysql]# ls -l
total 176164
drwx------ 2 mysql mysql    4096 Nov  6 11:07 aazj
-rw-rw---- 1 mysql mysql      543 Nov  6 11:13 general.log
-rw-r----- 1 mysql mysql 79691776 Nov  6 11:07 ibdata1
-rw-r----- 1 mysql mysql 50331648 Nov  6 11:07 ib_logfile0
-rw-r----- 1 mysql mysql 50331648 Nov  6 11:07 ib_logfile1
-rw-rw---- 1 mysql mysql      543 Nov  6 11:13 localhost-slow.log
drwx------ 2 mysql mysql    4096 Nov  6 11:07 mysql
-rw-rw---- 1 mysql mysql        0 Nov  6 11:12 mysql-bin.index
drwx------ 2 mysql mysql    4096 Nov  6 11:07 performance_schema
drwx------ 2 mysql mysql    4096 Nov  6 11:07 t
-rw-r----- 1 mysql mysql      24 Nov  6 11:07 xtrabackup_binlog_pos_innodb
-rw-r----- 1 mysql mysql      487 Nov  6 11:07 xtrabackup_info

不然启动会在error.log中报错:

2015-11-06 11:13:55 3542 [ERROR] InnoDB: ./ibdata1 can't be opened in read-write mode

2015-11-06 11:13:55 3542 [ERROR] InnoDB: The system tablespace must be writable!

2015-11-06 11:13:55 3542 [ERROR] Plugin 'InnoDB' init function returned error.

2015-11-06 11:13:55 3542 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

2015-11-06 11:13:55 3542 [ERROR] Unknown/unsupported storage engine: InnoDB

2015-11-06 11:13:55 3542 [ERROR] Aborting

启动成功之后,datadir目录下各种文件都产生了:

[root@localhost mysql]# pwd

/var/lib/mysql

[root@localhost mysql]# ls

aazj      general.log  ib_logfile0  localhost-slow.log  mysql-bin.000001  performance_schema  xtrabackup_binlog_pos_innodb

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/656593acf3a21794ce9642049b430016.html