当前位置:网站首页>MySQL backup and recovery + experiment
MySQL backup and recovery + experiment
2022-07-05 01:28:00 【kiroct】
mysql Backup and recovery of
The importance of data backup
The main purpose of backup is disaster recovery
In the production environment , Data security is crucial
Any loss of data can have serious consequences
Cause of data loss
Program error
Human error
Arithmetic error
Disk failure
disaster ( Such as fire 、 The earthquake ) And theft
From the point of view of physics and logic , Backup can be divided into
The physical backup : Physical files for database operating system ( Such as data files 、 Log files, etc ) Backup of
Physical backup method
Cold backup ( Offline backup ) : It was done when the database was shut down
Hot backup ( Online backup ) : The database is running , Database dependent log files
Warm backup : Database lock table ( Not writable but readable ) Backup operation in the state of
Logical backup : For database logic components ( Such as : Database objects such as tables ) Backup of
From the perspective of database backup strategy , Backup can be divided into :
Full backup : Every time you make a full backup of the database
Differential backup : Back up files that have been modified since the last full backup
Incremental backup : Only files modified after the last full backup or incremental backup will be backed up
Common backup methods
Physical cold standby
The database is closed at the time of backup , Directly package database files
Fast backup , Recovery is also the simplest
Special backup tool mydump or mysqlhotcopy
mysqldump Common logical backup tools
mysqlhotcopy Only have Backup MyISAM and ARCHIVE surface
Enable two - Perform incremental backup of hexadecimal logs
Incremental backup , Need to refresh binary log
Third party tools backup
Free of charge MySQL Hot backup software Percona XtraBackup
MySQL Full backup ( Definition )
■ For the entire database 、 Backup of database structure and file structure
■ What you save is the database at the time of backup completion
■ The difference between backup and incremental backup is
Physical cold backup and recovery
close MySQL database
Use tar Command to package the database folder directly
Replace existing directly MySQL directory
mysqldump Backup and recovery
MySQL Backup tools included , It is convenient to realize MySQL Backup of
You can add the specified library 、 The table is exported as SQL Script
Use command mysq| Import backup data
Back up the database completely
Case study 1: First create a database
mysql Full backup of
InnoDB The database of the storage engine is stored in three files on disk : db.opt ( Table properties file )、 Table name . frm( Table structure file )、 Table name .ibd( Table data file ).
mysql A complete recovery of
systemctl start mysqld
(1) Recover database
mysql -u root -p -e 'drop database kgc; ’
#“-e” Options , Used to specify the connection MySQL Command executed after , Automatically exit after the command is executed
mysql -u root -P -e 'SHOW DATABASES; ’
mysql -u root -p < /opt/kgc.sql
(2) Restore data table
When the backup file contains only the backup of tables , Without the statement of the created library , The library name must be specified when performing the import operation , And the target library must exist .
mysql Incremental logging and recovery
----MySQL Incremental backup ----
mysql Incremental recovery of
边栏推荐
- Senior Test / development programmers write no bugs? Qualifications (shackles) don't be afraid of mistakes
- batchnorm. Py this file single GPU operation error solution
- 【FPGA教程案例9】基于vivado核的时钟管理器设计与实现
- DOM basic syntax
- Basic operation of database and table ----- the concept of index
- [wave modeling 2] three dimensional wave modeling and wave generator modeling matlab simulation
- When the industrial Internet era is truly developed and improved, it will witness the birth of giants in every scene
- [FPGA tutorial case 10] design and implementation of complex multiplier based on Verilog
- 微信小程序:微群人脉微信小程序源码下载全新社群系统优化版支持代理会员系统功能超高收益
- 無心劍英譯席慕容《無怨的青春》
猜你喜欢
phpstrom设置函数注释说明
Wechat applet: new independent backstage Yuelao office one yuan dating blind box
增量备份 ?db full
[development of large e-commerce projects] performance pressure test - Optimization - impact of middleware on performance -40
[untitled]
Blue Bridge Cup Square filling (DFS backtracking)
Express routing, express middleware, using express write interface
微信小程序:全新独立后台月老办事处一元交友盲盒
Implementation steps of master detail detail layout mode of SAP ui5 application
Pandora IOT development board learning (RT thread) - Experiment 4 buzzer + motor experiment [key external interrupt] (learning notes)
随机推荐
Database postragesql client authentication
19. Delete the penultimate node of the linked list
Behind the cluster listing, to what extent is the Chinese restaurant chain "rolled"?
整理混乱的头文件,我用include what you use
Discrete mathematics: propositional symbolization of predicate logic
Implementation steps of master detail detail layout mode of SAP ui5 application
Arbitrum:二维费用
Wechat applet: wechat applet source code download new community system optimized version support agent member system function super high income
PHP 约瑟夫环问题
Take you ten days to easily complete the go micro service series (IX. link tracking)
How to use words to describe breaking change in Spartacus UI of SAP e-commerce cloud
es使用collapseBuilder去重和只返回某个字段
After reading the average code written by Microsoft God, I realized that I was still too young
Database postragesql lock management
Pandora IOT development board learning (RT thread) - Experiment 4 buzzer + motor experiment [key external interrupt] (learning notes)
微信小程序:最新wordpress黑金壁纸微信小程序 二开修复版源码下载支持流量主收益
Logstash、Fluentd、Fluent Bit、Vector? How to choose the appropriate open source log collector
Redis(1)之Redis简介
【LeetCode】88. Merge two ordered arrays
【大型电商项目开发】性能压测-性能监控-堆内存与垃圾回收-39