This brief tutorial shows students and new users how to back up WordPress databases.
One simple task every webmaster should learn is backing up MySQL databases. You should always 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 easy 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.
On the next page, choose the Quick export method and click Go, as shown in the image below.
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:
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.