1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Backup Mysql In Command Line With Compression

Discussion in 'MySQL' started by 123addme, Jan 26, 2013.

  1. #1
    For those who looking for way to backup mysql database,
    you can use mysqldump to backup mysql database.
    Below is the script example to backup mysql database in command line:-

    $ mysqldump -h localhost -u username -p password database_name > backup_db.sql
    Code (markup):
    If your mysql database is very big, you might want to compress your sql file.
    Just use the mysql backup command below and pipe the output to gzip,
    then you will get the output as gzip file.

    $ mysqldump -u username -h localhost -p password database_name | gzip -9 > backup_db.sql.gz
    Code (markup):
    If you want to extract the .gz file, use the command below:

    $ gunzip backup_db.sql.gz
    Code (markup):

     
    123addme, Jan 26, 2013 IP