当前位置:网站首页>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语句
边栏推荐
猜你喜欢

Source code of campus secondary market

MySQL中100w数据表比1000w数据表查询更快吗?

Netease strict selection offline data warehouse quality construction practice

织梦dedecms资源素材教程下载网站模板源码(带手机移动端)附安装教程

Transport layer user datagram protocol (UDP)

VQA不只需要图片,还需要外部知识!华盛顿大学&微软提出提出REVIVE,用GPT-3和Wikidata来辅助回答问题!...

NuScenes关于Radar的配置信息

【牛客网刷题系列 之 Verilog快速入门】~ 移位运算与乘法

浅析 Istio——可观测性
![[practical chapter of correlation analysis] why can't Bi software do correlation analysis](/img/f2/4f99deb63b1beffae90b8a1fb270d1.png)
[practical chapter of correlation analysis] why can't Bi software do correlation analysis
随机推荐
idea输出台输出中文乱码问题
Laravel - composer installs the specified laravel version
Heavyweight! The latest SCI impact factors were released in 2022, and the ranking of the three famous journals NCS and the top10 of domestic journals has changed (the latest impact factors in 2022 are
Redis transaction mechanism
PostgreSql学习(基于菜鸟课程)
建立自己的网站(19)
Redis master-slave replication principle
Chapter 13 event operation of canvas
仿头条新闻资讯dz模板 Discuz新闻资讯商业版GBK模板源码
EXCEL的查询功能Vlookup
模电 2个NPN管组成的恒流源电路分析
MySQL 数据库 - 通用语法 DDL DML DQL DCL
类模板案例-【数组类封装】
VQA不只需要图片,还需要外部知识!华盛顿大学&微软提出提出REVIVE,用GPT-3和Wikidata来辅助回答问题!...
《canvas》之第12章 其他应用
[top] blog instructions, bulletin board, message board, about bloggers
FIFO implementation with single port RAM
Query function of Excel vlookup
[shell] Jenkins shell realizes automatic deployment
China arsenic trioxide industry research and future forecast report (2022 Edition)