当前位置:网站首页>MySQL 8.0 data backup and recovery
MySQL 8.0 data backup and recovery
2022-07-03 20:21:00 【S_ zhangmin】
Although some management measures have been taken to ensure the security of the database , However, uncertain accidents are always likely to cause data loss , For example, accidental power failure 、 Careless operation errors of the administrator may cause data loss . One of the most important measures to ensure data security is to ensure that data is backed up regularly . If the data in the database is lost or an error occurs , Backup data can be used for recovery , In this way, the loss caused by unexpected causes is reduced as much as possible . Data backup will be introduced 、 Data recovery 、 Relevant knowledge of data migration and data import and Export .
PART1. The data backup
Data backup is one of the most important tasks of Data Administrators . Accidental system crash or hardware damage may lead to the loss of the database , therefore MySQL Administrators should back up databases regularly , So that when an accident happens , Minimize losses . Data backup is 3 Methods .
1. Use MySQLdump Command backup
MySQLdump yes MySQL Provides a very useful database backup tool .MySQLdump When the order is executed , The database can be backed up as a text file , This file actually contains several CREATE and INSERT sentence , Use these statements to recreate tables and insert data .
mysqldump -u user -h host -ppassword dbname[tbname, [tbname...]]>filename.sqluser Represents the user name ;host Indicates the host name of the login user ;password Is the login password ;dbname Name of the database to be backed up ;tbname by dbname The database that needs to be backed up , You can specify multiple tables that need to be backed up ; Right arrow symbol ”>“ tell MySQLdump Write the definition and data of the backup data table to the backup file ;filename.sql Is the name of the backup file .
1. Use MySQLdump Back up all tables in a single database
Just to understand MySQLdump How tools work , Here is a complete database example . Log in first MySQL, Create according to the following database structure booksDB Database and tables , And insert the data record .
Be careful : Here's a guarantee C Under the plate backup Folder exists , Otherwise, an error message will be prompted : The system could not find the specified path .
-- end
边栏推荐
- Kubernetes cluster builds efk log collection platform
- Realize user registration and login
- How to set the system volume programmatically- How to programmatically set the system volume?
- 【c】 Digital bomb
- In 2021, the global revenue of syphilis rapid detection kits was about US $608.1 million, and it is expected to reach US $712.9 million in 2028
- Typora charges, WTF? Still need support
- IP address is such an important knowledge that it's useless to listen to a younger student?
- FPGA learning notes: vivado 2019.1 project creation
- Plan for the first half of 2022 -- pass the PMP Exam
- Global and Chinese market of high temperature Silver sintering paste 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢

Make a simple text logo with DW

Don't be afraid of no foundation. Zero foundation doesn't need any technology to reinstall the computer system

How to modify the network IP addresses of mobile phones and computers?

2.5 conversion of different data types (2)

Test changes in Devops mode -- learning and thinking

thrift go

Q&A:Transformer, Bert, ELMO, GPT, VIT

Machine learning support vector machine SVM

5- (4-nitrophenyl) - 10,15,20-triphenylporphyrin ntpph2/ntppzn/ntppmn/ntppfe/ntppni/ntppcu/ntppcd/ntppco and other metal complexes

FAQs for datawhale learning!
随机推荐
Typora charges, WTF? Still need support
LabVIEW training
Today's work summary and plan: February 14, 2022
Based on laravel 5.5\5.6\5 X solution to the failure of installing laravel ide helper
Sparse matrix (triple) creation, transpose, traversal, addition, subtraction, multiplication. C implementation
Micro service knowledge sorting - three pieces of micro Service Technology
AcWing 1460. Where am i?
Find a line in a file and remove it
JMeter connection database
[Yu Yue education] basic reference materials of manufacturing technology of Shanghai Jiaotong University
Global and Chinese market of micro positioning technology 2022-2028: Research Report on technology, participants, trends, market size and share
In 2021, the global revenue of syphilis rapid detection kits was about US $608.1 million, and it is expected to reach US $712.9 million in 2028
Global and Chinese market of electrolyte analyzers 2022-2028: Research Report on technology, participants, trends, market size and share
How to set the system volume programmatically- How to programmatically set the system volume?
Micro service knowledge sorting - asynchronous communication technology
JMeter plug-in installation
About unregistered transfer login page
Basic command of IP address configuration ---ip V4
Analysis of gas fee setting under eip1559
5- (4-nitrophenyl) - 10,15,20-triphenylporphyrin ntpph2/ntppzn/ntppmn/ntppfe/ntppni/ntppcu/ntppcd/ntppco and other metal complexes