- Plesk for Linux
- Plesk for Windows
How to rename a MySQL database on a Plesk server?
Warning: If the database, which is going to be renamed, belongs to a CMS website (WordPress, Joomla!, Drupal, etc), don't forget to change the database name in the CMS configuration file.
Click on a section to expand
This method works for those cases when a database was not installed along with a CMS via Plesk Applications.
In Plesk, go to Domains > example.com > Databases.
Under the old database, click Copy > in the opened window, specify a new database name and click OK.
Go to Database Users > click on the user of the old database > in the Database field, select the new database from the drop-down list > click OK.
Remove the old database.
In Plesk, go to Tools & Settings > Databases Servers > click on the button next to MySQL to enter phpMyAdmin.
In phpMyAdmin, select a database that is going to be renamed from the list (1) > click Operations (2) > specify a new database name under the Rename database to field (3) > click Go (4) > confirm the operation by clicking OK in the opened window.
Specify the new database name in the Plesk database:
Find the ID of the old database. Replace OLD_NAME with an old database name:
# plesk db "select id, name from data_bases where name='OLD_NAME'"
| id | name |
| ID | OLD_NAME |
Rename the database using the ID from the step above. Replace NEW_NAME with a new database name:
# plesk db "update data_bases set name='NEW_NAME' where id='ID'"
Note: If after a database name change is done, a connection database error is shown, follow the steps here in order to re-apply the database credentials