当前位置:网站首页>mysql 备份与还原
mysql 备份与还原
2022-06-29 14:31:00 【qq_29566629】
mysql 备份:
在MySQL中导出一个表的命令:mysqldump -h 192.168.5.237 -u root -p dvwa users >user.sql
导出一个数据库的命令:mysqldump -h 192.168.5.237 -u root -p -B dvwa >dvwa_backup.sql 这里需要注意的是: -B加与不加有以下区别:
加 -B
不加 -B
如上面两个图所示,加了-B以后生成的sql语句中会有创建数据库create命令和使用数据库use的命令导出所有的数据库: mysqldump -h 192.168.5.237 -u root -p --all-databases >all_databases.txt
也可以使用:mysqldump -h 192.168.5.237 -u root -p -A >all_databases_A.sql
mysql 还原:
还原数据库:
mysql -h 192.168.5.1 -u root -p < dvwa.sql还原数据表:
mysql -h 192.168.5.1 -u root -p test < user.sql
其中test是要导入的数据库名,user.sql是创建表和导入数据的sql语句
边栏推荐
- China arsenic trioxide industry research and future forecast report (2022 Edition)
- The first lesson on cloud - how easy is it to build a small broken station? The old driver of cloud computing will take you one hour to finish it
- 两个字的名字如何变成有空格的3个字符的名字
- Paper study -- accurate accounting of annual total runoff control rate considering the interannual variation characteristics of rainfall
- 网易严选离线数仓质量建设实践
- JUC multithreading: creation and working principle of thread pool
- FIFO implementation with single port RAM
- 华理生物冲刺科创板:年营收2.26亿 拟募资8亿
- Redis master-slave replication principle
- Swagger2的配置教程
猜你喜欢

Redis installation in windows and Linux Environment
![[Verilog quick start of Niuke online question series] ~ shift operation and multiplication](/img/ea/457abb2ad0d39ffe4b235576c49a8f.png)
[Verilog quick start of Niuke online question series] ~ shift operation and multiplication

Build your own website (19)

Nuscenes configuration information about radar

云上第一课 | 建个小破站有多简单?云计算老司机带你一小时搞定

【Try to Hack】vulnhub DC2

Chapter 12 other applications of canvas

EMC-浪涌防护及退耦设计

类模板案例-【数组类封装】
![[important notice] the 2022 series of awards and recommendations of China graphics society were launched](/img/ae/2fe0cf9964e5fd3b18e5f295638d8b.png)
[important notice] the 2022 series of awards and recommendations of China graphics society were launched
随机推荐
Imitation headline news information DZ template discuz news information business version GBK template source code
Analysis of istio -- observability
【shell】jenkins shell实现自动部署
Illustration of Ctrip quarterly report: net revenue of RMB 4.1 billion has been "halved" compared with that before the outbreak
Source code of campus secondary market
If I am in Foshan, where can I open an account? Is it safe to open an account online?
VQA不只需要图片,还需要外部知识!华盛顿大学&微软提出提出REVIVE,用GPT-3和Wikidata来辅助回答问题!...
MySQL中100w数据表比1000w数据表查询更快吗?
phpcms打开后台首页时向官网发送升级请求觉得卡怎么办?
Redis installation in windows and Linux Environment
卫龙更新招股书:年营收48亿 创始人刘卫平家族色彩浓厚
Ogg synchronize MySQL data to greenplus
Redis主从复制原理
QRCode自定义二维码中间图片
FIFO implementation with single port RAM
Laravel - Composer 安装指定 Laravel 版本
《canvas》之第12章 其他应用
delphi7中 url的编码
第五届中国软件开源创新大赛 | openGauss赛道直播培训
Digital IC code -- traffic lights