Backup and restore MySQL database


The following command will backup your database.

"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqldump.exe" --database GpsGateServer --single-transaction -h localhost -ppassword -u root > C:\backups\GpsGateServer.mysqldump

You can then schedule this command to be executed once per day, preferably at night using "Scheduled Task" feature you find in the Windows Control Panel.

It is recommended that you make the backup to a network drive (and not C: as in the sample above). First of all it will increase performance to not write down the backup to the same disk as the original database. And secondly you should have the backup on a separate server, in best case off site.


"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysql.exe" --database GpsGateServer -h localhost -ppassword -u root < C:\backups\GpsGateServer.mysqldump


Please replace 5.5 with the version of MySQL you have installed. If you installed MySQL as part of the setup Wizard you have 5.5 installed.