当前位置:网站首页>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
边栏推荐
- 流批一体在京东的探索与实践
- Basic operations of database and table ----- create index
- LeetCode周赛 + AcWing周赛(T4/T3)分析对比
- Daily question brushing record (13)
- Hand drawn video website
- C语音常用的位运算技巧
- Call Huawei order service to verify the purchase token interface and return connection reset
- The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
- Phpstrom setting function annotation description
- Intel sapphire rapids SP Zhiqiang es processor cache memory split exposure
猜你喜欢
Great God developed the new H5 version of arXiv, saying goodbye to formula typography errors in one step, and mobile phones can also easily read literature
Arbitrum: two-dimensional cost
Complex, complicated and numerous: illustration of seven types of code coupling
Wechat applet: independent background with distribution function, Yuelao office blind box for making friends
What happened to those who focused on automated testing?
Basic operation of database and table ----- the concept of index
Kibana installation and configuration
The performance of major mainstream programming languages is PK, and the results are unexpected
PHP wechat official account development
【CTF】AWDP总结(Web)
随机推荐
Wechat applet: exclusive applet version of the whole network, independent wechat community contacts
[microprocessor] VHDL development of microprocessor based on FPGA
Yyds dry goods inventory kubernetes management business configuration methods? (08)
【海浪建模1】海浪建模的理论分析和matlab仿真
Hedhat firewall
Grabbing and sorting out external articles -- status bar [4]
[pure tone hearing test] pure tone hearing test system based on MATLAB
Redis(1)之Redis简介
Database postragesq BSD authentication
Database postragesql client authentication
Analysis and comparison of leetcode weekly race + acwing weekly race (t4/t3)
Global and Chinese market of veterinary thermometers 2022-2028: Research Report on technology, participants, trends, market size and share
How to use words to describe breaking change in Spartacus UI of SAP e-commerce cloud
Redis master-slave replication cluster and recovery ideas for abnormal data loss # yyds dry goods inventory #
潘多拉 IOT 开发板学习(RT-Thread)—— 实验4 蜂鸣器+马达实验【按键外部中断】(学习笔记)
Detailed explanation of multi-mode input event distribution mechanism
Introduction to redis (1)
微信小程序:星宿UI V1.5 wordpress系统资讯资源博客下载小程序微信QQ双端源码支持wordpress二级分类 加载动画优化
【海浪建模2】三维海浪建模以及海浪发电机建模matlab仿真
Chia Tai International Futures: what is the master account and how to open it?