How to restore compressed mysql backup file

July 31, 2008 · Filed Under Linux / Unix Commands, Mysql 
To restore compressed backup files you can do the following:
gunzip < [backupfile.sql.gz] | mysql -u [uname] -p[pass] [dbname]

If you need to restore a database that already exists, you’ll need to use mysqlimport command. The syntax for mysqlimport is as follows:

mysqlimport -u [uname] -p[pass] [dbname] [backupfile.sql]

If you enjoyed this post and found it useful, please write your comments. You comments would encourage us to write more. Also make sure you subscribe to our RSS feed!

We Provide Custom PHP Programming for Joomla , Wordpress, OScommerce, Creloaded, Xcart and any other opensource solution you can think of at www.technoIntellects.com.

Get our Joomla Hosting Packages at the affordable price with unlimited services

Comments

One Response to “How to restore compressed mysql backup file”

  1. Mysql database migration using shell command : Technical Tips @ TechnoIntellects.com on July 31st, 2008 12:41 pm

    [...] How to restore compressed mysql backup file [...]

Leave a Reply