Would you like to learn how to backup a database on MySQL? In this tutorial, we are going to show you how to use the MySQL command-line to backup a database.
• Ubuntu 20.04
• Ubuntu 19.04
• Ubuntu 18.04
• MySQL 8.0.19
Equipment list
The following section presents the list of equipment used to create this tutorial.
As an Amazon Associate, I earn from qualifying purchases.
Related tutorial – MySQL
On this page, we offer quick access to a list of tutorials related to MySQL.
Tutorial MySQL – Backup a database
Access the MySQL command-line.
Verify the list of databases.
Here is the command output:
In our example, a user account named AAA01 has permission over the database named MYDATABASE.
On the Linux command-line, backup the MySQL database.
Verify the content of the MySQL backup file.
Here is the file content.
Congratulations! You created a MySQL database backup.
Tutorial MySQL – Restore a database
On the Linux command-line, restore the MySQL database backup.
Access the MySQL command-line.
Verify the list of databases.
Here is the command output:
Configure the user permission over the restored MySQL database.
In our example, a user account named AAA01 has permission over the database named MYDATABASE.
Access the MySQL command-line using the new account.
Verify the data on a MySQL table.
Here is the command output.
In our example, we restored a MySQL database name DATABASE.
Congratulations! You are able to restore a MySQL database.