时间:2021-07-01 10:21:17 帮助过:2人阅读
net stop mysql xcopy c:\mysql\data\cm_db\*.* c:\db_bak\cm_db\%date:~0,10%\ /S /I net start mysql
然后用windows计划任务,定期执行db_bak.bat
2、mysqldump备份成sql文件
============== 例子环境: MySQL 安装位置:C:\MySQL 论坛数据库名称为:cm_db MySQL root 密码:123456 数据库备份目的地:D:\db_backup\
@echo off set "Ymd=%date:~,4%%date:~5,2%%date:~8,2%" C:\MySQL\bin\mysqldump --opt -u root --password=123456 cm_db > D:\db_backup\bbs_%Ymd%.sql @echo on
然后用windows计划任务,定期执行db_bak.bat
mysql自动备份(windows)
标签: