【发布时间】:2018-03-22 11:33:59
【问题描述】:
我正在使用批处理文件在 Windows 上备份我的 MySQL 数据库。如何将每个表保存在单独的文件中?当前批处理文件将所有表保存到每个数据库的一个文件中。
这是批处理文件
FOR /D %%F IN (*) DO (
SET %%F=!%%F:@002d=-!
%mysqldumpexe% --user=%dbuser% --password=%dbpass% --databases --routines --log-error=%errorLogPath% %%F > "%backupfldr%%%F.%backuptime%.sql"
::How- Grab the list of tables inside the current database
::How- Backup current table from the current database into a.sql (database-table_name.sql)
)
【问题讨论】:
-
This question 展示了如何从数据库中检索表列表。
-
我对批处理不熟悉,所以我不知道如何在循环中实现它
-
谢谢。相关链接解决了我的问题。
标签: mysql batch-file