Translate This Page

About Me

profile_picture_120

Name: Joshua Lyon
Birthday: August 8, 1985
Location: Valley Ranch (Irving), TX
E-mail: josh@boshdirect.com

Related Articles

Content View Hits : 492613
MySQL backup from Shell
Written by Josh Lyon   
Friday, 25 January 2008 07:09

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

Comments (0)add comment

Write comment

busy