web analytics

Mysql Day wise Backup

I am using Windows 7 System. My Mysql is installed into D: . It is done simple using a Batch file. Batch file will call automatically using scheduler etc. In my batch file d:\DB_Backup is the Backup Directory. We are creating current dated folder Into DB_Backup folder and create .sql file into current dated folder.

cd\
D:
for /f "tokens=1-4 delims=/ " %%a in ('Date /t') do (
set Month=%%b
set Day=%%c
set Year=%%d
)
set DATES=%Day%-%Month%-%Year%
cd\
cd d:\DB_Backup
mkdir %DATES%
cd\

cd D:\wamp\bin\mysql\mysql5.5.24\bin
mysqldump -uroot -proot1234 database1 > d:\DB_Backup\%DATES%\database1.sql 
exit

We can fallow the same way for linux or other system.

Bivash Kanti Pal

Hi guys, This is the place where developers are sharing there thoughts....

Leave a Reply

Your email address will not be published. Required fields are marked *

Result of *Captcha loading...

Do NOT follow this link or you will be banned from the site!