WordPress: Backing up Database Using mysqldump on the Command Line

View Database Config*
cat /var/www/wp-config.php | grep DB

* Path to wp-config.php may be different.

Export Database
mysqldump --no-tablespaces -u wordpress_user -p wordpress | xz -9ec > wordpress_20190520.sql.xz
List Backup Files
ls -l
Scan Through Compressed Database
xzless wordpress_20190520.sql.xz

Leave a comment

Your email address will not be published. Required fields are marked *