Home >Database >Mysql Tutorial >WindowsServer服务器端MySQL数据库自动备份_MySQL

WindowsServer服务器端MySQL数据库自动备份_MySQL

WBOY
WBOYOriginal
2016-06-01 13:00:171064browse
1.给root账户授权所有sql权限
grant all privileges on *.* to root@"%" identified by ".";
flush privileges;
2.建立bat批处理文件
@echo off
set path=%path%;D:\Program Files\MySQL\MySQL Server 5.5\bin
set y=%date:~0,4%
set m=%date:~5,2%
set d=%date:~8,2%
set h=%time:~0,2%
set cdate=%y%%m%%d%_%h%
mysqldump -h 127.0.0.1 -u root --password=***** -e -R --database cmsis > f:\data\cmsis_%cdate%.sql
exit

其中cmsis为要备份的数据库,当该批处理文件执行时会在f:\data下生成如cmsis_20140510_16.sql的文件

3.添加计划任务

(1)程序->附件->系统工具->任务计划->添加任务计划
\

(2)单击下一步
\

单击浏览选择刚才建立的bat文件

(3)设置任务执行时间
\

\
再单击下一步输入管理员密码即可!
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