4

Win使用Bat脚本一键导出所有MySQL数据库完整备份为SQL文件

 3 years ago
source link: https://www.itpwd.com/342.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Win使用Bat脚本一键导出所有MySQL数据库完整备份为SQL文件_Win笔记_IT密码

保存代码,另存为backup.bat执行

@echo off
set "Ymd=%date:~,4%%date:~5,2%%date:~8,2%"
for %%a in (
www1_webdb
www2_webdb
www3_webdb
www4_webdb
) do (
"C:\MySQL Server\bin\mysqldump.exe" --opt -u root --password=mysqlpwd %%a > D:\mysql_db_backup\%%a_%Ymd%.sql
)

@echo on



About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK