MySQL Forums
Forum List  »  Backup

Re: Windows GUI Backup/Restore Tool
Posted by: Peter Brawley
Date: November 02, 2017 08:59PM

OK, for you there's good news and bad news.

Bad news first. There's no repeat no GUI tool that's smart enough to protect your databases from what you don't know. None. Nil. Nada.

We could digress here about the fundamental engineering rule governing GUIs---the more automatic the software, the stoopider it has to be---but I'll leave that line of inquiry to you.

So you'll need to learn commands for backing up and restoring data. The good news is that once you've learnt them, you'll be doing a much better job.

To get you started, here's part of a mysqldump backup batch file for a 5.6 MySQL Windows installation of mine. It runs from the c:\backup folder ...

REM BACKUP ALL MYSQL DBs TO CURRENT FOLDER
@echo off
c:
cd \backup

REM FOR THE BACKUP FILENAME, SET XDATE TO TODAY
for /f "tokens=2-4 delims=/- " %%a in ('date /t') do set XDate=%%c%%a%%b

REM ENSURE BACKUP FILE DOESN'T EXIST
if exist mysql_%XDate%.sql del mysql_%XDate%.sql

REM DO THE DUMP
cd c:\wamp\bin\mysql\mysql5.6.17\bin
REM SUBSTITUTE YOUR MYSQL USERNAME & PASWORD FOR USR & PWD
echo Running mysqldump ...
mysqldump -uUSR -pPWD -A --add-drop-database -K -E -R >c:\backup\mysql_%XDate%.sql
cd c:\backup
dir mysql_%XDate%.sql
pause

To understand what those mysqldump options do, consult the manual page for mysqldump.



Edited 1 time(s). Last edit at 11/02/2017 09:01PM by Peter Brawley.

Options: ReplyQuote


Subject
Views
Written By
Posted
1820
October 25, 2017 06:49AM
664
October 25, 2017 09:42AM
Re: Windows GUI Backup/Restore Tool
1763
November 02, 2017 08:59PM


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.