我试图在没有任何停机时间的情况下进行mysql备份,但无法使用Xtrabackup进行备份。
实际数据库的大小几乎与40+ GB差不多。我首先想让自己满意。因此,我在服务器上创建了一个包含5000个表(全部是InnoDB表)的示例数据库。根据博客"在某些情况下,如果使用此技术,则可以使备份中的表完全丢失。“--单事务在生产环境中使用是不安全的。
[root@localhost mysql]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 56
Server version: 5.5.25a-log MySQL Community Server (GPL) by Remi
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| innodbtest |
| mysql |
+--------------------+
3 rows in set (0.00 sec)
mysql> use innodbtest;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show create table T4000;
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| T4000 | CREATE TABLE `T4000` (
`A` int(11) NOT NULL,
`B` int(11) DEFAULT NULL,
`C` char(1) DEFAULT NULL,
PRIMARY KEY (`A`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> show create table T3040;
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| T3040 | CREATE TABLE `T3040` (
`A` int(11) NOT NULL,
`B` int(11) DEFAULT NULL,
`C` char(1) DEFAULT NULL,
PRIMARY KEY (`A`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql>我使用了工具xtrabackup和遵循创建备份的步骤
xtrabackup --backup --datadir=/var/lib/mysql --target-dir=/opt/bkp/在备份之后,我不会在备份位置得到".ibd“文件。
[root@localhost mysql]# ls -al /opt/bkp/
total 190676
drwxr-xr-x 2 root root 4096 Nov 27 19:02 .
drwxr-xr-x 5 root root 4096 Nov 27 18:08 ..
-rw-r----- 1 root root 195035136 Nov 27 19:02 ibdata1
-rw-r----- 1 root root 79 Nov 27 19:02 xtrabackup_checkpoints
-rw-r----- 1 root root 2560 Nov 27 19:02 xtrabackup_logfile
[root@localhost mysql]#在使用xtrabackup还原数据库之后,我也不会在另一个服务器上获得数据库文件夹"innodbtest“。
我哪里错了?
发布于 2012-11-28 06:35:13
https://dba.stackexchange.com/questions/29364
复制相似问题