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

A simple operation method for backing up MYSQL

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

Share

Shulou(Shulou.com)06/01 Report--

The following mainly brings you the simple operation method of backing up MYSQL. I hope these contents can bring you practical use, which is also the main purpose of this article. All right, don't talk too much nonsense, let's just read the following.

Types and characteristics of backup

Cold backup (cold backup): mysql service needs to be turned off, and read and write requests are not allowed.

Warm backup: the service is online, but only read requests are supported, but write requests are not allowed

Hot backup (hot backup): while backing up, the business will not be affected.

Based on the scope of the data set to be backed up

Full backup: full backup, backup all character sets.

Incremental backup: data that has changed since incremental backup's last full backup or incremental backup cannot be used alone. With the help of full backup, the frequency of backup depends on how often the data is updated.

Differential backup: data that has changed since differential backup's last full backup.

Recommended recovery strategy:

Full + incremental + binary log

Complete + difference + binary log

Make a full backup of the database:

Mysqldump-uroot-p-single-transaction-master-data=2-databases zy > D:\ mysql\ priv\ 20171206-1.sql

-- single-transaction: hot standby InnoDB tables can be implemented based on this option; therefore, it is not necessary to use-- lock-all-tables at the same time.

-- master-data=2 records the location of the binary log at that time of backup and comments it out. 1 is uncommented.

-- databases hellodb specifies the database to back up

View the binary information from the backup:

4. Operate the change information of the database and view the log information of the data customer again.

Show master status

5. Test incremental backup

6. View the operation record of a log point

7. Hot backup needs to close the binary log when importing data

Set sql_log_bin=0

Flush logs-refresh the log

8. Import previously backed up binaries

For the above simple operation method of backing up MYSQL, do you think it is very helpful. If you need to know more, please continue to follow our industry information. I'm sure you'll like it.

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