0
我正在使用批处理文件在Windows上备份我的MySQL数据库。如何将每个表格保存在单个文件中?当前批处理文件将所有表保存为每个数据库的一个文件。使用批处理文件备份每个表格在不同文件中的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)
)
[此问题](https://stackoverflow.com/questions/9620198/how-to-get-the-sizes-of-the-tables-of-a-mysql-database?rq=1)显示了如何从数据库中检索表的列表。 – fvu
我不熟悉批处理,所以我不知道如何在循环内执行它 – dai
谢谢。相关链接解决了我的问题。 – dai