Have you installed WordPress on your Synology NAS or another application that uses a database but you don’t like the name of the database previously created with MariaDB 10 and want to change it? How can you do that? For one reason or another one day you may need to change the names of your databases. Nothing could be simpler. Follow my guide below.
STEP 1
Please Support My work by Making a Donation.
STEP 2
Launch the phpMyAdmin application.
STEP 3
Log into phpMyAdmin with your Administrator credentials. Follow the instructions in the image below.
STEP 4
On the left sidebar select the database you want to rename. In my case, I have a database named “testing” that I want to rename. After you click on the database, at the top of the page click on the Operations tab. Now scroll down a little bit to see the option “Rename database to” and, in the box just below it, type in your new database name. In my case I have typed MARIUSHOSTING. After that, click on Go at the right of the page. Now your database is renamed.
STEP 5
If everything went well, you will see the new database name in the left sidebar in phpMyAdmin.
STEP 6
If you run WordPress or any other applications, remember to change the wp-config.php file and, at DB_NAME, add the new database name you have previously created on STEP 4.
STEP 7
The change will not be applied immediately in your NAS DSM. You need to wait 5 minutes then refresh the page or you will see an error that says: “Error establishing a database connection“. When the 5 minutes have passed, your site or application will be back online.
Note: Before you rename any database in your Synology NAS, make a Backup of MariaDB 10 using the Hyper Backup package just in case something goes wrong.
Note: If you rename a database and this database has a user account with the same database name, your user account will be automatically deleted from the database. Log into your phpMyadmin / Users accounts / Add user account to create a new user account for the database.
Note: phpMyadmin is the graphical interface for MariaDB 10.
This post was updated on Tuesday / August 4th, 2020 at 1:35 PM