Skip to content

Instantly share code, notes, and snippets.

@loopj
Created March 6, 2011 03:12
Show Gist options
  • Save loopj/856993 to your computer and use it in GitHub Desktop.
Save loopj/856993 to your computer and use it in GitHub Desktop.
Script to create mysql backups which will restore quickly
#!/bin/bash
echo "SET autocommit=0;
SET unique_checks=0;
SET foreign_key_checks=0;" > backup.sql
mysqldump -u myuser --password=mypassword mydatabase >> backup.sql
echo "COMMIT;" >> backup.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment