Would you like to learn how to rename a database on MySQL? In this tutorial, we are going to show you how to use the MySQL command-line to rename a database.

• Ubuntu 20.04
• Ubuntu 19.04
• Ubuntu 18.04
• MySQL 8.0.19

MySQL Related Tutorial:

On this page, we offer quick access to a list of tutorials related to MySQL.

Tutorial MySQL - Rename a database

Access the MySQL command-line.

Copy to Clipboard

Verify the list of databases.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

In our example, a user account named AAA01 has permission over the database named MYDATABASE.

Copy to Clipboard

On the Linux command-line, backup the MySQL database.

Copy to Clipboard

Access the MySQL command-line.

Copy to Clipboard

Create a new database using the desired name.

Copy to Clipboard

Configure the same user permission on the new database.

Copy to Clipboard

On the Linux command-line, restore the MySQL database backup.

Copy to Clipboard

In our example, we rename a MySQL database named MYDATABASE to NEWDATABASE.

Delete the original MySQL database.

Copy to Clipboard

Congratulations! You are able to rename a MySQL database.