一,mysql中mysqldump+bat处理文件
执行mysql数据库备份的脚本(bat文件内容)
代码如下 | 复制代码 |
@echo off set host=localhost set username=root set passward=ansure set database=weihe set backup_path=D:\db_backup\ echo "Mysql Backup , please waitting" mysqldump -h%host% -u%username% -p%passward% --skip-lock-tables %database% > %backup_path%\%database%_%date:~0,10%.sql echo "OK ! " |
二,xcopy新建批处理文件 backup.dat,里面输入以下代码:
代码如下 | 复制代码 |
net stop mysql xcopy "C:\Program Files\MySQL\MySQL Server 5.0\data\piaoyi\*.*" D:\db_backup\%date:~0,10%\ /y net start mysql |
时间: 2024-10-02 16:24:10