Showing posts with label backup. Show all posts
Showing posts with label backup. Show all posts

Monday, January 30, 2017

Windows Batch Script to backup local MySQL database

Create a file name "backup.bat" with following contents and double click to backup selected database to local file.

@ECHO OFF
cd C:\xampp\mysql\bin
mysqldump.exe -uroot -hlocalhost some_db_name > "C:\tmp\back_up.sql"
echo DB Backuped
mysql.exe -uroot -hlocalhost -e "drop database if exists some_db_name";
echo DB Removed
pause
exit;