Blog
How to backup MySQL & MariaDB database using mysqldump
- September 13, 2020
- Posted by: ElastiCourse
- Category: How-To Linux

Backing up your website database before major changes or updates is important step, and there are many different ways to backup a database using GUI or CLI. In this article you will learn how to use a utility called mysqldump
to backup a MySQL or MariaDB database. The same instructions work for both database engines.
First, we need to identify the database we are backing up, you can login to mysql to show all cureent databases using the following commands:
mysql -u root -p
show databases;
You should get an output similar to this:
mysql> show databases;
+——————–+
| Database |
+——————–+
| bitnami_wordpress |
| information_schema |
| mysql |
| performance_schema |
| sys |
+——————–+
5 rows in set (0.01 sec)
The database of interest is called bitnami_wordpress
in my case, so I just need to enter the following mysqldump
command to take a snapshot of it:
mysqldump -u root -p bitnami_wordpress > backup.sql
Finally if you need to have the backup file locally, you can download the backup.sql
output file using an SFTP client like FileZilla.
Leave a Reply Cancel reply
You must be logged in to post a comment.