MySQL Forums
Forum List  »  MySQL Administrator

Re: MySQL GUI Tool - BACKUP using command line
Posted by: Barry Galbraith
Date: October 19, 2009 10:31PM

If you have MySQLAdministrator, you can schedule it to run at whatever time you want.

If you want a bat file for command line then copy this to a file, and it will usemysqldump to dump your database. Adjust the file name and databases to back up to your own requirement.
Note that mysqldump files are NOT restorable with MySQLAdministrator.


~~~~~~~~~~~~~~~~~~
@echo off
for /f "tokens=1,2" %%u in ('date /t') do set d=%%v
for /f "tokens=1" %%u in ('time /t') do set t=%%u
if "%t:~1,1%"==":" set t=0%t%
set datestr=%d:~6,4%%d:~3,2%%d:~0,2%
set timestr=%t:~0,2%%t:~3,2%
mysqldump -uroot -ppassword --result-file="d:/all_backup "%datestr%" "%timestr%".sql" --all-databases

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Or, you build a backup project with MySQL administrator, schedule it, then open your Scheduled tasks to see the commandline.
Copy/paste the commandline into your bat file.

Disable the scheduled task if you don't want it to run.
That backup WILL be restorable with MySQLAdministrator.

Good luck,
Barry.

Options: ReplyQuote


Subject
Written By
Posted
Re: MySQL GUI Tool - BACKUP using command line
October 19, 2009 10:31PM


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.