Cannot remove a database from a domain

Created:

2016-11-16 12:52:53 UTC

Modified:

2017-08-16 16:30:47 UTC

2

Was this article helpful?


Have more questions?

Submit a request

Cannot remove a database from a domain

Applicable to:

  • Plesk 10.x for Windows
  • Plesk 12.5 for Linux
  • Plesk 10.x for Linux
  • Plesk 11.x for Windows
  • Plesk 11.x for Linux
  • Plesk 12.0 for Windows
  • Plesk 12.0 for Linux
  • Plesk 12.5 for Windows

Symptoms

The check-box next to a database name is grayed out and the database name contains ( This resource is used by the installed site application).

Cause

The database is used by an installed site application. It can only be removed along with the respective application.

Resolution

To remove the database, the parent application also needs to be removed from Plesk: Domains > example.com > Applications

If no applications that may be using the database are displayed, the database needs to be marked as not belonging to any application using the steps below. This problem may be the result of errors when deleting a site application.

  1. Create the psa database backup according to How to backup/restore a Plesk database dump?
  2. Find the domain ID in the Plesk database:

    set @dom_id = (select id from domains where name='example.tld');
  3. Find the connection ID between the application and the database:

    SELECT data_bases.name,apsResources.pleskId FROM `data_bases` INNER JOIN `DatabaseServers` ON data_bases.db_server_id = DatabaseServers.id LEFT JOIN `apsResources` ON apsResources.pleskId = data_bases.id and apsResources.pleskType="db" WHERE (dom_id = @dom_id)\\G

    *************************** 1. row ***************************
    name: database_user123werjkdsfuo
    pleskId: 23
  4. Delete the connection using the "pleskId" found on the previous step:

    delete from apsResources where pleskType="db" and pleskId=23;
  5. Remove the database using Plesk > Domains > example.com > Databases.

Have more questions? Submit a request
Please sign in to leave a comment.