• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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