Notes on the MySQL database backup process

Notes on the MySQL database backup process

Today I looked at some things related to data backup and summarized several things to note about MySQL data backup. Let me share them briefly.

Each DBA may have a different understanding of MySQL backup. Backup can be divided into the following dimensions:

File type classification:

1. Physical backup. Physical backup represented by xtrabackup is the most commonly used backup method and is often used to back up large databases.

2. Logical backup, represented by mysqldump, is more suitable for backing up data less than 50G.

Classification by backup content:

1. Full backup, which is easy to understand, is a complete backup of the database

2. Incremental backup is based on full backup. For example, if the full backup deadline is yesterday, then the data from yesterday to today is incremental backup.

3. Log backup. Log backup is to back up the MySQL binlog based on the backup file. We know that the binlog records the DDL and DML operations of MySQL. Binlog can be used to restore an intermediate state of the database.

Today, when I was sorting out the online backup content, I found the following knowledge points that may be useful. If they are helpful to you, that would be great. If not, just treat it as my own fun~

1. When we use xtrabackup to back up, for a single machine with multiple instances, it is best to back up at different times, because backing up multiple MySQL instances at the same time will have a greater impact on disk IO. If there is other data being written at this time, it will have an impact

2. You can use NFS mounting to back up local data on a remote machine. This can alleviate the local backup pressure and ensure that problems with the local hard disk do not affect data recovery. When applying this method, you need to consider the network bandwidth between machines. The architecture diagram is as follows:

3. We know that if we use the backup file backed up by xtrabackup to restore, we need to perform two steps. The first step is apply_log and the second step is copy back. It is recommended to directly apply log after the backup is completed. If it fails, you can back it up again. Otherwise, if it is available by default, it will be difficult to deal with problems when restoring.

4. Incremental recovery based on binlog is also a more convenient approach. It not only performs full backup according to a certain period, but also regularly backs up binlog. During this period, data at any time point can be restored through the backed-up binlog.

5. If there are multiple machines online, we can use mysqldump and xtrabackup to perform backups and set a threshold, such as 50G. For data volumes below 50G, mysqldump performs better. For data volumes above 50G, consider using xtrabackup to perform backups.

6. The purpose of backing up data is to restore it. It is best to try to restore it after the backup is completed to ensure the availability of the backup data.

7. For instances with large amounts of data, sometimes the backup time is particularly long and recovery is inconvenient. You can use the cross-data center slave library method to back up data. At this time, you can build a delayed slave library so that when the main library errs, the slave library can stop in time and skip the related erroneous operation steps.

The above are the details of the precautions for the MySQL database backup process. For more information about MySQL backup, please pay attention to other related articles on 123WORDPRESS.COM!

You may also be interested in:
  • Shell script to backup MySQL database data regularly and retain it for a specified time
  • Mysql database scheduled backup script sharing
  • How to implement scheduled backup of CentOS MySQL database
  • MySQL database backup and recovery implementation code
  • MySQL database introduction: detailed explanation of database backup operation
  • Analysis of MySQL data backup and recovery implementation methods
  • MySQL scheduled database backup operation example
  • Summary of various implementation methods of mysql database backup
  • Linux implements scheduled backup of MySQL database and deletes backup files older than 30 days
  • Linux regularly backs up the MySQL database and deletes previous backup files (recommended)
  • Mysql backup multiple database code examples
  • Selection and thinking of MySQL data backup method

<<:  Detailed explanation of basic syntax and data types of JavaScript

>>:  Tomcat exception solution (Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986)

Recommend

In-depth explanation of MySQL stored procedures (in, out, inout)

1. Introduction It has been supported since versi...

How to deploy HTTPS for free on Tencent Cloud

Recently, when I was writing a WeChat applet, the...

The process of deploying a project to another host using Jenkins

environment Hostname ip address Serve Jenkins 192...

The whole process of upgrading Angular single project to multiple projects

Table of contents Preface Development Environment...

One-click installation of MySQL 5.7 and password policy modification method

1. One-click installation of Mysql script [root@u...

The meaning and calculation method of QPS and TPS of MySQL database

When doing DB benchmark testing, qps and tps are ...

MySQL data insertion optimization method concurrent_insert

When a thread executes a DELAYED statement for a ...

How to use Maxwell to synchronize MySQL data in real time

Table of contents About Maxwell Configuration and...

WeChat applet realizes the function of uploading pictures

This article example shares the specific code for...

Quickly solve the problem that the mysql57 service suddenly disappeared

one, G:\MySQL\MySQL Server 5.7\bin> mysqld --i...

Vue implements a small countdown function

Countdown function needs to be implemented in man...

MySQL obtains the current date and time function example detailed explanation

Get the current date + time (date + time) functio...

Implementing a simple calculator based on JavaScript

This article shares the specific code of JavaScri...

Detailed process record of Vue2 initiating requests using Axios

Table of contents Preface Axios installation and ...

Solutions to common problems using Elasticsearch

1. Using it with redis will cause Netty startup c...