Home > Database > Mysql Tutorial > 如何在Win下mysql备份恢复命令_MySQL

如何在Win下mysql备份恢复命令_MySQL

WBOY
Release: 2016-06-01 14:01:18
Original
862 people have browsed it

假设mysql安装在c:盘,mysql数据库的用户名是root,密码是123456,数据库名是database_name,在d:盘根目录下面存放备份数据库,备份数据库名字为backup20070713.sql(20070713.sql为备份日期)

  备份数据库:

  mysqldump -uroot -p123456 database_name>d:/backup20070713.sql

  恢复数据库:

  删除原有数据库,建立数据库,把备份数据库导入。

  mysqladmin -uroot -p123456 drop database_name

  mysqladmin -uroot -p123456 create database_name

  mysql -uroot -p123456 database_name

  注:在导入备份数据库前,database_name如果没有,是需要创建的;而且与backup20070713.sql中数据库名是一样的才能导入。

  注:环境Windows命令行
 

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template