Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the backup test of mysql xtrabackup on the windows platform?

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Mysql xtrabackup in the windows platform backup test is how, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.

Xtrabackup has two main tools: xtrabackup and innobackupex

Xtrabackup can only back up and restore innodb, and only .ibd files are backed up. It doesn't care about .frm files. DBA has to provide them when restoring.

Innobackupex can back up and restore MyISAM files and .frm files, and has a friendly encapsulation of xtrabackup, so it can be used for full library backup.

After downloading and decompressing to the xtrabackup directory of disk C, it is found that there are 4 files. Xtrabackup.exe is an executable file:

C:\ xtrabackup > dir

The volume in drive C is Windows8_OS

The serial number of the volume is 0E54-579B

Directory of C:\ xtrabackup

2016-06-03 09:42.

2016-06-03 09:42..

2009-12-08 14:37 6656 cat.exe

2003-10-23 17:35 135680 grep.exe

2011-04-21 15:23 90876 innobackupex.pl

2011-04-20 11:39 4863488 xtrabackup.exe

Here we use the xtrabackup command to test the full database backup of innodb:

Usage of the xtrabackup command:

Usage: [C:\ xtrabackup\ xtrabackup [--defaults-file=#]-- backup | C:\ xtrabackup\ xtrabackup [--defaults-file=#]-- prepare] [OPTIONS]

Set up an innodb test library:

Mysql > create database duansf

Query OK, 1 row affected (0.17 sec)

Mysql > use duansf

Database changed

Mysql >

Mysql >

Mysql >

Mysql >

Mysql > create table dsf (id int)

Query OK, 0 rows affected (0.37 sec)

Mysql > insert into dsf values (1)

Query OK, 1 row affected (0.11 sec)

Mysql > insert into dsf values (2)

Query OK, 1 row affected (0.14 sec)

Mysql > insert into dsf values (3)

Query OK, 1 row affected (0.06 sec)

Mysql > insert into dsf values (4)

Query OK, 1 row affected (0.17 sec)

Mysql > insert into dsf values (5)

Query OK, 1 row affected (0.09 sec)

Mysql > select * from dsf

+-+

| | id |

+-+

| | 1 |

| | 2 |

| | 3 |

| | 4 |

| | 5 |

+-+

5 rows in set (0.03 sec)

Mysql >

View the directory where the data file is located:

Mysql > show variables like 'datadir'

+-+ +

| | Variable_name | Value |

+-+ +

| | datadir | C:\ ProgramData\ MySQL\ MySQL Server 5.5\ Data\ | |

+-+ +

1 row in set (0.00 sec)

Mysql >

Full backup:

C:\ xtrabackup\ xtrabackup-- target-dir=C:\ xtrabackup\ full-- backup-- datadir= "C:\ ProgramData\ MySQL\ MySQL Server 5.5\ Data\"

C:\ xtrabackup > C:\ xtrabackup\ xtrabackup-- target-dir=C:\ xtrabackup\ full-- backup

-- datadir= "C:\ ProgramData\ MySQL\ MySQL Server 5.5\ Data\ duansf"

C:\ xtrabackup\ xtrabackup Ver undefined Rev undefined for 5.5.9 Win64 (x86)

Xtrabackup: cd to C:\ ProgramData\ MySQL\ MySQL Server 5.5\ Data\ duansf

Xtrabackup: Target instance is assumed as followings.

Xtrabackup: innodb_data_home_dir =.\

Xtrabackup: innodb_data_file_path = ibdata1:10M:autoextend

Xtrabackup: innodb_log_group_home_dir =.\

Xtrabackup: innodb_log_files_in_group = 2

Xtrabackup: innodb_log_file_size = 5242880

InnoDB: The first specified data file.\ ibdata1 did not exist:

InnoDB: a new database to be created!

160603 10:32:56 InnoDB: Setting file.\ ibdata1 size to 10 MB

InnoDB: Database physically writes the file full: wait...

Xtrabackup: Something wrong with source files...

It was found that there was an error. After studying it later, copy C:\ Program Files (x86)\ MySQL\ MySQL Server 5.5\ my.ini to the c:\ xtrabackup directory and execute the following command to pass the test:

C:\ xtrabackup > xtrabackup.exe-- defaults-file=C:\ xtrabackup\ my.ini-- backup-- target-dir=C:\ xtrabackup\ full

Xtrabackup.exe Ver undefined Rev undefined for 5.5.9 Win64 (x86)

Xtrabackup: cd to C:/ProgramData/MySQL/MySQL Server 5.5/Data/

Xtrabackup: Target instance is assumed as followings.

Xtrabackup: innodb_data_home_dir =.\

Xtrabackup: innodb_data_file_path = ibdata1:10M:autoextend

Xtrabackup: innodb_log_group_home_dir =.\

Xtrabackup: innodb_log_files_in_group = 2

Xtrabackup: innodb_log_file_size = 118489088

> log scanned up to (1625547)

[01] Copying.\ ibdata1

To C:\ xtrabackup\ full/ibdata1

[01]... done

Xtrabackup: The latest check point (for incremental): '1625547'

Xtrabackup: Stopping log copying thread.. > > log scanned up to (1625547)

Xtrabackup: Transaction log of lsn (1625547) to (1625547) was copied.

Note: if you repeat the xtrabackup command to perform the backup, you will get an error. I guess this may be due to the fact that xtrabackup is only a beta version on the windows platform and has not been released, so

The windows platform version is still used carefully in the production environment.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report