Backup DB - Export and Import MySql Database in Linux


How to Export, Import Mysql Database using MySql Dump  and zip it using gzip in linux.


 Export:
 
 mysqldump --routines -u {user} -p {database} | gzip > {database}.sql.gz
 
 
 Import:
 
 gzip -dc < {database}.sql.gz | mysql -u {user} -p {database}
 
 
 
 
 
I hope this command will help! 

No comments:

Post a Comment