About Me

Josh Lyon

Name: Joshua Lyon
Birthday: August 8, 1985
Location: Grapevine, TX
E-mail: This e-mail address is being protected from spam bots, you need JavaScript enabled to view it

feed image
Home arrow View Blog arrow Josh's Blog arrow MySQL backup from Shell
Jan 25 2008
MySQL backup from Shell
Written by Josh Lyon   
Friday, 25 January 2008
 

The following is a short code snippet on how to view which MySQL databases are available for a user, then a command to back them up. This should work on Unix and Linux variants.

To view what databases are available to be backed up, run the following command:
$ mysql -u root -h localhost -p -Bse 'show databases'

To backup each database, run the following command:
$ mysqldump -u root -h localhost -pmypassword databasename | gzip -9 > faqs-db.sql.gz

Related articles.

Add Comment
Name
E-mail
Title  
Comment
 
Available characters: 600
   Notify me of follow-up comments
  Mathguard security question:
XWO         DMX      
  N    H    F R   MDW
DOD   739   S5R      
M      T      P   BH1
8X6         6TS      
   
   

 

No comment posted

Add your comment



mXcomment 1.0.8 © 2007-2008 - visualclinic.fr
License Creative Commons - Some rights reserved
< Prev   Next >