Symptoms
-
When creating a database in Plesk at Domains > example.com > Databases, the operation fails with the error message:
A database with the name db_example already exists.
-
The database is not listed in Plesk at Tools & Settings > Database Servers > MySQL/MariaDB (under databases).
Cause
The database already exists in MySQL:
# plesk db -ne"show databases" | grep db_example
db_example
Resolution
Remove the existing database from MySQL/MariaDB
If the database is not needed, remove it from MySQL/MariaDB:
-
Connect to the Plesk server via SSH.
-
Just in case, create a database dump:
# plesk db dump db_example > db_example.sql
-
Connect to MySQL/MariaDB server:
# plesk db
-
Drop the existing database:
MariaDB> DROP DATABASE db_example;
Register the existing database in Plesk
Register the existing database in Plesk using the instructions from this KB article.