MySQL备份与恢复之percona-xtrabackup软件的使用
在前面,我们讲到MySQL冷备、热备、mysqldump、热拷贝、保证数据的一致性。因为mysql冷备、mysqldump、mysql热拷贝均不能实现增量
一 使用percona-xtrabackup的原因
在前面,我们讲到MySQL冷备、热备、mysqldump、热拷贝、保证数据的一致性。因为mysql冷备、mysqldump、mysql热拷贝均不能实现增量备份,在实际环境中增量备份是使用较多的,percona-xtrabackup就是为实现增量备份而生,因此我们需要使用percona-xtrabackup。
相关阅读:
MySQL备份与恢复之真实环境使用冷备
MySQL备份与恢复之冷备
MySQL备份与恢复之热备
MySQL 备份与恢复mysqldump
MySQL备份与恢复之热拷贝
MySQL备份与恢复之保证数据一致性
本文讲解percona-xtrabackup软件的使用,下一篇文章讲解percona-xtrabackup实现增量备份及恢复 。
二 什么是percona-xtrabackup
Percona XtraBackup is an open-source hot backup utility for MySQL -based servers that doesn’t lock your database during the backup.
It can back up data from , ,and tableson MySQL 5.1 , 5.5 and5.6 servers, as well as Percona Server with .For a high-level overview of many of its advanced features, including a featurecomparison, please see AboutPercona Xtrabackup.
Whether it is a 24x7 highly loaded server or alow-transaction-volume environment, Percona XtraBackup isdesigned to make backups a seamless procedure without disrupting theperformance of the server in a production environment.Commercial support contracts areavailable.
Percona XtraBackup is a combination of the xtrabackup C program,and the innobackupex Perl script. The xtrabackupprogramcopies and manipulates and datafiles, and the Perl script enables enhanced functionality,such as interacting with a running MySQL server and backing up tables.
三 软件及文档获取
软件获取
文档获取
四 软件使用讲解
注:本文采用的percona-xtrabackup版本为2.0.2,操作系统版本为RHEL 6.1 Server,MySQL版本为5.1
第一步,,准备文件并拷贝文件
[root@larrywen ule-mysql]# ll percona-xtrabackup-2.0.2-461.rhel6.x86_64.rpm -rwxr-xr-x. 1 root root 3786628 Sep 10 13:45 percona-xtrabackup-2.0.2-461.rhel6.x86_64.rpm [root@larrywen ule-mysql]# scp percona-xtrabackup-2.0.2-461.rhel6.x86_64.rpm 192.168.1.11:/opt[root@serv01 opt]# yum install percona-xtrabackup-2.0.2-461.rhel6.x86_64.rpm -y Installed: percona-xtrabackup.x86_64 0:2.0.2-461.rhel6 Dependency Installed: mysql.x86_64 0:5.1.52-1.el6_0.1
第三步,初始化备份
[root@serv01 databackup]# innobackupex --user=root --password=123456 /databackup/ InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy and Percona Inc 2009-2012. All Rights Reserved. …… innobackupex: Backup created in directory '/databackup/2013-09-10_21-49-44' innobackupex: MySQL binlog position: filename 'mysql-bin.000001', position 7312 130910 21:50:03 innobackupex: completed OK!
第四步,这样的备份文件无法使用,我们需要做统一检查
[root@serv01 databackup]# ll total 4 drwxr-xr-x. 9 root root 4096 Sep 10 21:50 2013-09-10_21-49-44 #做统一检查 [root@serv01 databackup]# innobackupex --apply-log /databackup/2013-09-10_21-49-44/ InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy and Percona Inc 2009-2012. All Rights Reserved. …… xtrabackup: starting shutdown with innodb_fast_shutdown = 1 130910 21:51:52 InnoDB: Starting shutdown... 130910 21:51:56 InnoDB: Shutdown completed; log sequence number 2098188 130910 21:51:56 innobackupex: completed OK!
第五步,模拟数据丢失
[root@serv01 databackup]# rm -rf /usr/local/mysql/data/* [root@serv01 databackup]# ll /usr/local/mysql/data/ total 0更多详情见请继续阅读下一页的精彩内容:

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Full table scanning may be faster in MySQL than using indexes. Specific cases include: 1) the data volume is small; 2) when the query returns a large amount of data; 3) when the index column is not highly selective; 4) when the complex query. By analyzing query plans, optimizing indexes, avoiding over-index and regularly maintaining tables, you can make the best choices in practical applications.

Yes, MySQL can be installed on Windows 7, and although Microsoft has stopped supporting Windows 7, MySQL is still compatible with it. However, the following points should be noted during the installation process: Download the MySQL installer for Windows. Select the appropriate version of MySQL (community or enterprise). Select the appropriate installation directory and character set during the installation process. Set the root user password and keep it properly. Connect to the database for testing. Note the compatibility and security issues on Windows 7, and it is recommended to upgrade to a supported operating system.

InnoDB's full-text search capabilities are very powerful, which can significantly improve database query efficiency and ability to process large amounts of text data. 1) InnoDB implements full-text search through inverted indexing, supporting basic and advanced search queries. 2) Use MATCH and AGAINST keywords to search, support Boolean mode and phrase search. 3) Optimization methods include using word segmentation technology, periodic rebuilding of indexes and adjusting cache size to improve performance and accuracy.

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

The difference between clustered index and non-clustered index is: 1. Clustered index stores data rows in the index structure, which is suitable for querying by primary key and range. 2. The non-clustered index stores index key values and pointers to data rows, and is suitable for non-primary key column queries.

MySQL and MariaDB can coexist, but need to be configured with caution. The key is to allocate different port numbers and data directories to each database, and adjust parameters such as memory allocation and cache size. Connection pooling, application configuration, and version differences also need to be considered and need to be carefully tested and planned to avoid pitfalls. Running two databases simultaneously can cause performance problems in situations where resources are limited.

In MySQL database, the relationship between the user and the database is defined by permissions and tables. The user has a username and password to access the database. Permissions are granted through the GRANT command, while the table is created by the CREATE TABLE command. To establish a relationship between a user and a database, you need to create a database, create a user, and then grant permissions.

Data Integration Simplification: AmazonRDSMySQL and Redshift's zero ETL integration Efficient data integration is at the heart of a data-driven organization. Traditional ETL (extract, convert, load) processes are complex and time-consuming, especially when integrating databases (such as AmazonRDSMySQL) with data warehouses (such as Redshift). However, AWS provides zero ETL integration solutions that have completely changed this situation, providing a simplified, near-real-time solution for data migration from RDSMySQL to Redshift. This article will dive into RDSMySQL zero ETL integration with Redshift, explaining how it works and the advantages it brings to data engineers and developers.
