备份
set "Ymd=%date:~,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%"
md "D:\databackup\%Ymd%"
"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqldump.exe" --opt -Q databasename -uroot -p123456 > D:\databackup\databasename%Ymd%.sql
@echo off
mshta vbscript:msgbox("mysql backup successed!!!",6,"mysql backup")(window.close)
恢复
"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysql.exe" -uroot -p123456 ensjp < D:\databackup\databasename.sql
@echo off
mshta vbscript:msgbox("mysql restore successed!!!",6,"mysql restore")(window.close)
时间: 2024-10-08 01:26:34