Plesk login page displays error: DB query failed: Unknown error

Created:

2016-11-16 12:41:47 UTC

Modified:

2017-04-24 12:15:03 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Plesk login page displays error: DB query failed: Unknown error

Applicable to:

  • Plesk for Windows

Symptoms

Plesk login page shows the following error:

ERROR: PleskMainDBException
DB query failed: Unknown error

OR

ERROR: Exception: Unable to get administrator password: Can't decrypt data

OR

ERROR: Exception: Unable to get administrator password: The system cannot find the file specified. (Error code 2)

Cause

Plesk administrator password in the Windows registry and/or Plesk SQL Server administrator password in the mysql database are corrupted.

Resolution

Solution #1

First reset Plesk administrator password in the Windows registry, then Plesk SQL Server administrator password in the mysql database

  1. Add skip-grant-tables to the [PleskSQLServer] section in the %plesk_dir%\\mysql\\data\\my.ini file and save it.

  2. Restart the Plesk SQL Server service to let the skip-grant-tables option take effect:

    net stop plesksqlserver && net start plesksqlserver
  3. Set new password for Plesk administrator in the Windows registry:

    "%plesk_bin%\\plesksrvclient.exe" -set NEW_PASSWORD
  4. Set new password for Plesk SQL Server administrator in the mysql database:

    "%plesk_bin%\\plesksrvclient.exe" -set NEW_PASSWORD true

    Actually command above will reset both passwords - in the Windows registry and in the mysql database, but it will not work if password in registry still corrupted.

  5. Remove skip-grant-tables from %plesk_dir%\\mysql\\data\\my.ini and save it.

  6. Restart the Plesk SQL Server service.

Solution #2

First reset Plesk SQL Server administrator password in the mysql database, then Plesk administrator password in the Windows registry

  1. Add skip-grant-tables to the [PleskSQLServer] section in the %plesk_dir%\\mysql\\data\\my.ini file and save it.

  2. Restart the Plesk SQL Server service to let the skip-grant-tables option take effect.

  3. Find the username of the Plesk SQL Server administrator in the PLESK_DATABASE_LOGIN value in the Windows registry:

    reg query "HKLM\\SOFTWARE\\Wow6432Node\\Plesk\\PSA Config\\Config" /v PLESK_DATABASE_LOGIN

    HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Plesk\\PSA Config\\Config
    PLESK_DATABASE_LOGIN REG_SZ admin

    By default it is set to admin .

  4. Log in to the mysql database on the port 8306:

    "%plesk_dir%\\MySQL\\bin\\mysql.exe" -P8306 -Dmysql
  5. Update the password of the Plesk SQL administrator (replace NEW\_PASSWORD and admin with proper values):

    UPDATE user SET Password = password('NEW_PASSWORD') WHERE User = 'admin';
  6. Remove skip-grant-tables from %plesk_dir%\\mysql\\data\\my.ini and save it.

  7. Restart the Plesk SQL Server service.

  8. Set the same password as on the step 5 for the Plesk administrator in the Windows registry:

    "%plesk_bin%\\plesksrvclient.exe" -set NEW_PASSWORD

    OR:

    "%plesk_cli%\\init_conf.exe" --set-admin-password -passwd NEW_PASSWORD

    OR:

    "%plesk_cli%\\admin.exe" --set-password -passwd NEW_PASSWORD
Have more questions? Submit a request
Please sign in to leave a comment.