Home >Database >Mysql Tutorial >mysql使用mysqldump进行数据库备份_MySQL

mysql使用mysqldump进行数据库备份_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:27:03945browse

mysqldump

bitsCN.com

系统环境:win7,mysql5.5

mysql数据备份主要有两大类:

(1)文本格式的备份:msqldump程序

(2)二进制备份:mysqlhotcopy,cp,tar等

我主要使用mysqldump在本机上做一下测试:

1、备份数据库

(1)打开cmd

(2)cd到mysql安装目录的bin目录下

(3)输入:mysqldump -u root -p crashcourse > d:/crashcourse-backup-2013-11-28.sql(root是用户名的意思)

(4)输入密码

(5)完成备份

2、还原数据库

(1)使用msql command Line Client连接数据库

(2)创建数据库

输入:create database crashcourse2

(3)选择数据库

输入:use database crashcourse2

(4)还原

输入:source d:/crashcourse-backup-2013-11-28.sql

bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn