Home  >  Article  >  Database  >  MySql自动备份

MySql自动备份

WBOY
WBOYOriginal
2016-06-07 15:46:32972browse

创建一个批处理文件。例:mysql_db_bakcup.bat 添加如下语句: @echo off c: cd C:\Program Files\MySQL\MySQL Server 5.5\bin set Ymd=%date:~,4%%date:~5,2%%date:~8,2% mysqldump --opt -u smoon --password=smoon smoon D:\db_backup\samoon_%Ymd%.sql @

创建一个批处理文件。例:mysql_db_bakcup.bat

添加如下语句:

@echo off


c:

cd C:\Program Files\MySQL\MySQL Server 5.5\bin
set "Ymd=%date:~,4%%date:~5,2%%date:~8,2%"
mysqldump --opt -u smoon --password=smoon smoon > D:\db_backup\samoon_%Ymd%.sql


@echo on


说明:1.我的MySql的安装位置是C:\Program Files\MySQL\MySQL Server 5.5,其他人根据安装目录自行修改。

     2.我的备份路径是D:\db_backup,其他人自行修改

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