Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello,

I have this code for how to do mysql bat file for backup, this is the code.

echo off
echo Starting Backup of Mysql Database on server 
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set dt=%%c-%%a-%%b)
For /f "tokens=1-4 delims=:." %%a in ('echo %time%') do (set tm=%%a%%b%%c%%d)
set bkupfilename=%1 %dt% %tm%.sql
echo Backing up to file: %bkupfilename%
mysqldump -p 3306 -h 192.168.0.1 -u root -p 123456 bayanat>C:\mysql_daily_backups\"bayanat%bkupfilename%"
Posted
Updated 5-Aug-15 1:43am
v2
Comments
Kornfeld Eliyahu Peter 5-Aug-15 5:57am    
And what is the question?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900