• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue Accidentally deleted Admin user form DB

Bogdan1

Regular Pleskian
Hi,

I accidentally deleted admin user, and now can't access the admin panel.
Is it possible to recreate this user with all privileges?
I tried it with skip-grant-tables in my.cnf but getting this error:

Code:
MariaDB [mysql]> GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost';
ERROR 1290 (HY000): The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement

Also tried this: Unable to access Plesk on Linux: Access denied for user 'admin'@'localhost' (using password: YES)

Automatic

But still can't access the admin panel

Code:
Zend_Db_Adapter_Exception
SQLSTATE[HY000] [1045] Access denied for user 'admin'@'localhost' (using password: YES)

But for some reason I can do this:

Code:
[root@host tmp]# mysql -u admin -p
MariaDB [(none)]> use mysql;
Database changed

MariaDB [mysql]>
 
Last edited:
Also tried to generate new link /usr/local/psa/bin/admin --get-login-link with skip-grant-tables
but didn't help, same error -_-
 
Restoring from a dump will not work, because it requires Plesk to have access to the database. A manual database import will fail, too, because this requires root access to the database, too. Plesk cannot access the database when the root (admin) record is missing.

I think you should instead stop the MySQL service (MariaDB service), then use the --skip-grant-tables option when restarting it to be able to access the database at all. This will allow you to log in to the database without a password. From there you can add a new admin user, then restart the MySQL (MariaDB) service without --skip-grant-tables again. See a simple guide in How to set, change, and recover a MySQL root password (section "Recover your MySQL password"), but use "admin@localhost" instead of "root@localhost" when resetting it.
 
Back
Top