MySQL Forums
Forum List  »  Backup

How to do bat file mysql
Posted by: ahmed alqusaib
Date: August 09, 2015 12:43AM

I have this code for how to do mysql bat file for backup, this is the code. The problem is, it generates empty file. Here's 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%"

Options: ReplyQuote


Subject
Views
Written By
Posted
How to do bat file mysql
2527
August 09, 2015 12:43AM
1236
August 09, 2015 07:58PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.