How to Back up a WordPress Database

Laptop on desk with pen
Laptop on desk with pen

This brief tutorial shows students and new users how to back up WordPress databases.

A straightforward task every web admin should learn is backing up MySQL databases. It would be best always to have a backup plan when managing a website or IT system.

A plan that will get you restored if something goes wrong with the systems you’re managing.

That same strategy should apply when it comes to WordPress and MySQL databases.

This brief tutorial will show you how to easily back up your WordPress MySQL databases using cPanel and a Linux command terminal.

Backing up MySQL databases via cPanel

Since many WordPress blogs and websites are being hosted with the help of cPanel, let’s start with that.

cPanel is a website hosting tool that’s primarily geared toward new users as well as students. It makes managing websites easy, so you don’t need to understand Linux or programming.

cPanel uses phpMyAdmin to manage MySQL databases. More on phpMyAdmin can be found at the link below:

To backup MySQL databases via cPanel, go to the Databases section in cPanel and select phpMyAdmin, as shown below.


Next, select the WordPress database from the left menu and click the Export button, as shown in the image below.

wordpress mysql databases

On the next page, choose the Quick export method and click Go, as shown in the image below.

backup mysql databases via cpanel

Doing that will prompt you to select the location and save the export. Choose a location on your local computer and save the database file.

That’s how you back up MySQL databases via cPanel.

Backing up MySQL databases via the command line

Another way one can back up MySQL databases is via the Linux terminal. This is a more advanced way to back up MySQL.

With MySQL installed and access to your terminal server, run the commands below to log on to the database.

mysql -u root -p

When prompted, type the root password for the database to connect. To see the current list of databases, run the command statement below:

show databases;

That will show all the databases configured on the system. Next, record the database name you wish to backup and type exit.

On the terminal screen, run the commands below to backup the database

mysqldump -u root -p database_name > database_name.sql

Running that will download a copy of the database into the directory you’re working from.

Save a copy to a safe location, and you’re done. There might be other ways to back up MySQL databases, but these are the two most straightforward ways.

Thanks for reading, and please come back soon.

Posted by

I love computers; maybe way too much. What I learned I try to share at

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: