Skip to content

Instantly share code, notes, and snippets.

@iamajeesh
Created November 13, 2013 17:55
Show Gist options
  • Save iamajeesh/7453396 to your computer and use it in GitHub Desktop.
Save iamajeesh/7453396 to your computer and use it in GitHub Desktop.
SQL BACKUP of all DB on the SERVER/VPS to seperate files;
#when mysql command opens the sql console
mysql -e 'show databases' | while read dbname; do mysqldump --complete-insert "$dbname" > "$dbname".sql; done
#when mysql showes access denied error use -uROOT and -pPASSWORD
mysql -uROOT -pPASSWORD -e 'show databases' | while read dbname; do mysqldump -uROOT -pPASSWORD --complete-insert "$dbname" > "$dbname".sql; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment