惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Jina AI
Jina AI
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
S
Schneier on Security
人人都是产品经理
人人都是产品经理
博客园_首页
L
LangChain Blog
D
Docker
B
Blog
阮一峰的网络日志
阮一峰的网络日志
D
DataBreaches.Net
C
Check Point Blog
WordPress大学
WordPress大学
博客园 - 聂微东
P
Palo Alto Networks Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tailwind CSS Blog
腾讯CDC
Cisco Talos Blog
Cisco Talos Blog
A
Arctic Wolf
C
Cybersecurity and Infrastructure Security Agency CISA
Help Net Security
Help Net Security
The Last Watchdog
The Last Watchdog
有赞技术团队
有赞技术团队
美团技术团队
aimingoo的专栏
aimingoo的专栏
博客园 - 叶小钗
爱范儿
爱范儿
S
Security @ Cisco Blogs
MyScale Blog
MyScale Blog
C
Cisco Blogs
P
Proofpoint News Feed
I
Intezer
Last Week in AI
Last Week in AI
The Register - Security
The Register - Security
IT之家
IT之家
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Help Net Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Latest news
Latest news
M
MIT News - Artificial intelligence
N
News | PayPal Newsroom
G
Google Developers Blog
Cloudbric
Cloudbric
T
Troy Hunt's Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Recorded Future
Recorded Future
Hugging Face - Blog
Hugging Face - Blog
AWS News Blog
AWS News Blog

Rat's Blog - MySQL

一个强大的数据库管理工具:Navicat Premium中文破解版 - Rat's Blog CentOS 7安装配置Nginx 1.10、PHP 5.6、MySQL 5.7教程 Database.NET:一个好用的多数据库管理工具 - Rat's Blog 一个简单的MySQL备份bash脚本,直接发送到邮箱 - Rat's Blog 修改phpMyAdmin导入MySQL数据库文件大小限制 - Rat's Blog 使用Mysqldump备份数据库出现when using LOCK TABLES解决方法 - Rat's Blog Linux修改PhpMyAdmin(MySql)密码教程 - Rat's Blog LNMP删除和关闭Mysql日志 - Rat's Blog VPS登陆phpMyAdmin出现"#2002 无法登录 MySQL 服务器"错误的解决方法 - Rat's Blog
使用Mysqldump备份和还原MySQL数据库 - Rat's Blog
博主: Rat's · 2016-04-19 · via Rat's Blog - MySQL
  •  发布时间:
  •  7103 次浏览
  •   暂无评论
  •  887 字数
  • 分类: 建站知识
  1.  首页
  2. 正文  
  3. 分享到:

linux vps最方便,在ssh下使用就可。

登入MySQL数据库

mysql -uroot -pmypassword

root为mysql数据库用户名,mypassword为密码

备份MySQL数据库

1、备份单个数据库

mysqldump -uroot -pmypassword wp > wpbak.sql

root为mysql数据库用户名,mypassword为密码,wp为数据库名,wpbak.sql为备份成的文件。

2、备份多个数据库

mysqldump -uroot -pmypassword --databases wp stuff > wpbak.sql

root为mysql数据库用户名,mypassword为密码,wp、stuff为数据库名,wpbak.sql为备份成的文件。

3、备份所有数据库

mysqldump -uroot -pmypassword --all-databases > all-databases.sql

root为mysql数据库用户名,mypassword为密码,all-databases.sql为备份成的文件。

还原MySQL数据库

1、还原单个数据库

mysql -uroot -pmypassword [database_name] < dumpfilename.sql

root为mysql数据库用户名,mypassword为密码,[database_name]为数据库名,dumpfilename.sql为还原的数据

2、还原多个数据库

mysql -uroot -pmypassword < all-databases.sql

root为mysql数据库用户名,mypassword为密码,all-databases.sql为还原的数据


版权声明:本文为原创文章,版权归 Rat's Blog 所有,转载请注明出处!

本文链接:https://www.moerats.com/archives/26/

如教程需要更新,或者相关链接出现404,可以在文章下面评论留言。

Vultr新用户注册送100美元/16个机房按小时计费,支持支付宝,【点击查看】。