Applicable to:
- Plesk for Linux
- Plesk for Windows
Symptoms
-
When trying to delete database server at Tools & Settings > Database servers, the error below appears:
PLESK_ERROR: A database server should not be deleted while databases or database users are hosted there
-
In Tools & Settings > Database servers it is seen that there are no databases assigned to the database:
Cause
Plesk database inconsistency.
Resolution
- Log into Plesk;
- Go to Extensions > My Extensions > Repair Kit (if there is no such extension - install it using this guide: How to install Plesk extension?);
- In Repair Kit find Plesk Database and press Repair:
-
Connect to the server via SSH;
-
Run the command:
# plesk repair db
-
Connect to the server via SSH;
-
Log into psa database:
# plesk db
-
Find out ID of the database server in question:
MYSQL_LIN: > select * from DatabaseServers;
-
Obtain this ID and find out remaining database users and databases:
Databases:
MYSQL_LIN: > SELECT id, name FROM data_bases WHERE db_server_id=3;
+----+--------------+
| id | name |
+----+--------------+
| 23 | database_1 |
+----+--------------+
1 row in set (0.00 sec)Database users:
MYSQL_LIN: > SELECT id, login FROM db_users WHERE db_server_id=3;
+----+--------------+
| id | login |
+----+--------------+
| 25 | john_doe |
+----+--------------+
1 row in set (0.00 sec)Note: use the obtained on the 4th step ID instead of 3 in this example.
-
Delete found records:
Database:
MYSQL_LIN: > DELETE FROM data_bases WHERE id=23;
Users:
MYSQL_LIN: > DELETE FROM db_users WHERE id=25;
Note: use the ID's from the previous step accordingly instead of the 23 and 25.
Comments
0 comments
Please sign in to leave a comment.