To take the backup
---------------
mysqldump database > databasebackup.sql
To restore the mysql backup
---------------------------
mysql database < databasebackup.sql
To unzip database.sql.gz
------------------------
gunzip database.sql.gz