Basic Batch Script Backup MySQL Tables To Separate Files

This is a very crude example of how to use a windows batch script to backup each table within a mysql database to an individual sql file in a folder.

@ECHO OFF
FOR /F %%G IN ('"echo show tables | mysql -s -u user -ppassword mydatabase"')  DO mysqldump -s -u user --password=password mydatabase %%G > t:\mysqlbackup\tables\%%G.sql

Comments

Post a Comment

Popular posts from this blog

Basic Send Message to MQ with Java and IBM MQ JMS

Basic Receive Message to MQ with Java and IBM MQ JMS

Configure Database Connection using MyBatis