How to take complete MySQL backups via MySQLdump command in SSH?

How to take complete MySQL backups via MySQLdump command in SSH? [STEP BY STEP]☑️

In this article, you will learn how to back up the MySQL database inside one large compressed archive via mysqldump command in SSH.

You can also watch the short video tutorial on How to take complete MySQL backups via the MySQLdump command in SSH.

If you don’t want to watch the video tutorial, skip and proceed with the text version mentioned below.

To do this login to PuTTy using root credentials Copy the command given below and execute it in PuTTy

/usr/bin/mkdir -v /home/mysqlbackup/ ; /usr/bin/echo "Generating full MySQL backup..." ; /usr/bin/mysqldump --events --routines --triggers --all-databases | /usr/bin/gzip -9 > /home/mysqlbackup/"$(date +%F_%T)"_mysql_backup.sql.gz ; /usr/bin/echo "Complete."

To individually backup each database into its own compressed archive, execute the code given below:

/usr/bin/mkdir -v /home/mysqlbackup/ ; for DB in $(mysql -Be "show databases" | /usr/bin/grep -v 'row\|information_schema\|Database') ; do echo "Generating MySQL backup of $DB" ; /usr/bin/mysqldump --skip-lock-tables --events --routines --triggers ${DB} | /usr/bin/gzip -9 > /home/mysqlbackup/"$(date +%F_%T)"_${DB}.sql.gz ; done; /usr/bin/echo "Complete."

 

That’s all you are done!!!

We hope this video helped you learn How to take complete MySQL backups via MySQLdump command in SSH

For more information, kindly follow us on social media like Twitter and Facebook, and for video tutorials, subscribe to our YouTube channelhttps://youtube.com/redserverhost.com

Facebook Page- https://facebook.com/redserverhost

Twitter Page- https://twitter.com/redserverhost.com

If you have any query, feel free to let us know via the comments section below.

Thanks for Reading!!!

Tags: cheap linux hostingbuy linux hostingcheap reseller hostingbuy reseller hostingbest reseller hostingcheap web hostingcheapest web hostingcheapest reseller hosting,  cheap reseller hostcheap linux hostcheapest linux hostingbest linux hostingbest web hosting

Scroll to Top