当前位置:网站首页>6. Backup and recovery of MySQL database
6. Backup and recovery of MySQL database
2022-07-26 07:17:00 【Piglet vs Hengge】
Catalog
01、 Derived data : Generate SQL Script ---> Derived data
02、 Restore data : perform SQL Script --> Restore data
1、 Mode one : stay DOS Under the window , Need to log in mysql
2、 Mode two : stay DOS Under the window , You don't need to log in mysql
01、 Derived data : Generate SQL Script ---> Derived data
(1) Use it on the console mysqldump Command can be used to generate script text for the specified database .
(2) Be careful : The generated script text only contains the contents of the database , There will be no statement to create a database , So when restoring data , You need to manually create a database before recovering data .
grammar :mysqldump -u user name -p password Database name > The generated script file needs to be stored in the path

After the above command is executed , Can be found in F I found mystudent.sql Script files

02、 Restore data : perform SQL Script --> Restore data
1、 Mode one : stay DOS Under the window , Need to log in mysql
grammar :source The address where the script file is located ( for example :source F:\mystudent.sql)
Be careful :
perform SQL Script requires login mysql, Then enter the specified database , To execute SQL Script !!!
When executing the script, you need to check whether the tables in the current database conflict with the statements in the script file ( That is, whether the database in which the recovered data is stored duplicates the file in the recovered data )
(1) Create a database ( For example, create a database as :mynewstudent))
(2) Using a database
(3) perform SQL Script , Restore data

After the execution of the above command , The recovered data will be stored in mynewstudent In the database :

2、 Mode two : stay DOS Under the window , You don't need to log in mysql
grammar :mysql -u user name -p password Database name < The address where the script file is located
for example :mysql -uroot -proot mynewstudent<F:\mystudent.sql
(1) Premise : First create the database mynewstudent after , Then execute the following order

After the execution of the above command , The recovered data will be stored in mynewstudent In the database :

边栏推荐
- DaemonSet
- Realization of LED water lamp based on C51
- A guide for you to fully use TS
- [arm learning (8) AXF tool analysis]
- 为什么extern使用const修饰的变量会编译不过?
- Relevant configurations of pychart: change font style and size, change picture background, and change the font color of console output
- LTS(Light-Task-Scheduler)
- RGB-T追踪——【数据集基准】GTOT / RGBT210 / RGBT234 / VOT-2019-2020 / LasHeR / VTUAV
- NFT数字藏品开发:数字藏品与NFT的六大区别
- 成为 Apache 贡献者,So easy!
猜你喜欢

Apache Dolphinscheduler3.0.0-beta-1 版本发布,新增FlinkSQL、Zeppelin任务类型
unity3d-对象池的用法

NFT数字藏品系统开发:激活数字文化遗产

Redis migrate tool migration error.

【C语言】你真的了解printf吗?(printf典型易错,强烈建议收藏)

Pycharm的相关配置:改字体样式和大小、更改图片背景、更改控制台输出的字体颜色

【一库】妙啊!这个库组织npm脚本简直爆炸!

Precious metal knowledge: lethal short-term secret script

基于C51实现led流水灯

Lite actor: lightweight optimization of ark actor concurrency model
随机推荐
Drools (3): drools basic syntax (1)
unity3d-对象池的用法
Data platform scheduling upgrade and transformation | operation practice from Azkaban smooth transition to Apache dolphin scheduler
MySQL安装教程-手把手教你安装
Opengauss simple version installation error
IR tool in JIT and download, compile and use of jitwatch
NFT数字藏品系统开发:文学+数字藏品的碰撞
Image annotation software reference
Become an Apache contributor, so easy!
Opencv learning drawing shapes and text
Qt:列表框、表格、树形控件
How can man Bang write a new footnote to the value of the industry's first social responsibility report?
LTS(Light-Task-Scheduler)
从XSS Playload 学习浏览器解码
Typora免费版下载安装
Upgrade ecological proposition: what has Alibaba cloud brought to thousands of businesses?
Hcip - MPLS Technology
NFT数字藏品开发:数字艺术藏品赋能公益平台
Introduction to C language -- summary table of operator priority sorting
Agile and tidy way