当前位置:网站首页>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.sql
user 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
边栏推荐
- Cap and base theory
- 原生表格-滚动-合并功能
- Nacos usage of micro services
- Shortest path problem of graph theory (acwing template)
- Print linked list from end to end
- Global and Chinese market of two in one notebook computers 2022-2028: Research Report on technology, participants, trends, market size and share
- 4. Data splitting of Flink real-time project
- Popularize the basics of IP routing
- Implementation of stack
- Point cloud data denoising
猜你喜欢
Native table - scroll - merge function
LabVIEW training
JMeter plug-in installation
Shortest path problem of graph theory (acwing template)
Phpstudy set LAN access
2.7 format output of values
Test changes in Devops mode -- learning and thinking
Vscode reports an error according to the go plug-in go get connectex: a connection attempt failed because the connected party did not pro
1.5 learn to find mistakes first
Research Report on the overall scale, major manufacturers, major regions, products and application segmentation of rotary tablet presses in the global market in 2022
随机推荐
Example of peanut shell inner net penetration
2.4 conversion of different data types
Phpexcel import export
【c】 Digital bomb
Task of gradle learning
Oak-d raspberry pie cloud project [with detailed code]
How to set the system volume programmatically- How to programmatically set the system volume?
How to check the permission to write to a directory or file- How do you check for permissions to write to a directory or file?
4. Data binding
Global and Chinese markets for medical temperature sensors 2022-2028: Research Report on technology, participants, trends, market size and share
2.5 conversion of different data types (2)
jvm jni 及 pvm pybind11 大批量数据传输及优化
Nerfplusplus parameter format sorting
Deep search DFS + wide search BFS + traversal of trees and graphs + topological sequence (template article acwing)
Leetcode daily question solution: 540 A single element in an ordered array
Node MySQL serialize cannot rollback transactions
Teach you how to quickly recover data by deleting recycle bin files by mistake
Q&A:Transformer, Bert, ELMO, GPT, VIT
Global and Chinese market of cyanuric acid 2022-2028: Research Report on technology, participants, trends, market size and share
Camera calibration (I): robot hand eye calibration