Unable to remove database: Delete database user failed: Database 'example_db' does not exist

Refers to:

  • Plesk 11.0 for Windows
  • Plesk 11.5 for Windows
  • Plesk 12.0 for Windows
  • Plesk 12.5 for Windows

Created:

2016-11-16 13:10:47 UTC

Modified:

2016-12-21 20:07:40 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Unable to remove database: Delete database user failed: Database 'example_db' does not exist

Symptoms

It is not possible to remove a database of the domain example.com . Plesk shows the following error:

Delete database user failed: Database 'example_db' does not exist. Make sure that the name is entered correctly. at (VADOConnection::execute line 90) at execute console command --del-user(vconsoleapp::start line 132) at execute C:\\Parallels\\Plesk\\/admin/bin/mssqlmng --del-user "--server=.\\MSSQLSERVER2012" "--login=sa" "--password=*" "--database=example_db" "--user-login=example_db_user"(vconsoleapp::run line 143)

Cause

Database inconsistency. The database was dropped through command line or removed directly on database server.

Resolution

  1. Create a backup of psa database:

    "%plesk_dir%\\MySQL\\bin\\mysqldump.exe" -uadmin -p***** -P8306 psa > c:\\psa_current.sql
  2. Find the id of the domain example.com :

    mysql> select id, name from domains where name='example.com';
    +-----+----------------+
    | id | name |
    +-----+----------------+
    | 111 | example.com |
    +-----+----------------+
  3. Find the id of the database that should be removed:

    mysql> select * from data_bases where dom_id=111;
    +-----+------------+-------+--------+--------------+-----------------+
    | id | name | type | dom_id | db_server_id | default_user_id |
    +-----+------------+-------+--------+--------------+-----------------+
    | 725 | example_db | mssql | 111 | 2 | 741 |
    +-----+------------+-------+--------+--------------+-----------------+
  4. Find the id of the user of that database:

    mysql> select * from db_users where db_id=725;
    +-----+-----------------+------------+-------+--------+
    | id | login | account_id | db_id | status |
    +-----+-----------------+------------+-------+--------+
    | 741 | example_db_user | 2098 | 725 | normal |
    +-----+-----------------+------------+-------+--------+
  5. Remove the orphaned records:

    mysql> delete from db_users where id=741;

    mysql> delete from data_bases where id=725;
Have more questions? Submit a request
Please sign in to leave a comment.