• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • 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.

Admin account deleted, no Plesk access now. Help Please

P

philroberts

Guest
Admin account deleted, no Plesk access now.**RESOLVED**

Hi All,

We where changing a DB user in mysql and have deleted the admin account (or renamed it) and now have no access to plesk. I can log in to the server with SSH @ root but need help with the best way to add the admin account back.

any help is very much appreciated.

Phil
 
Last edited by a moderator:
During Plesk installation procedure root mysql account will be renamed to admin. So, you can try to rename root to admin and set the same password as in /etc/psa/.psa.shadow
 
During Plesk installation procedure root mysql account will be renamed to admin. So, you can try to rename root to admin and set the same password as in /etc/psa/.psa.shadow

Hello Igor,

Thank you for your reply,

I have managed to find my way into sql with SSH and was trying to add a new admin account into the user table but I am unsure what code to use as I am new to Linux.

I will give your idea a go & post back

Regards
Phil
 
Ok guys I managed to sort this out by doing the following to get into mysql and recreate the admin account with all privalages.

first log into your server @root with SSH

then edit the following file ( I am assuming you know how to use the Vi linux editor here)


vi /etc/my.cnf

and add the following option into the file on a clear line.

skip-grant-tables

then save the file (you may need to restart mysql or server at this point for the saved changes to work)

now i logged into mysql with a known user account (other than admin)


# mysql -u auser -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 123456
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.


Now we are in mysql I recreated the admin account as follows

mysql> /etc/init.d/mysqld restart

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> INSERT INTO user (Host,User,Password)
-> VALUES('localhost','admin',PASSWORD('plesk-password'));
Query OK, 1 row affected, 3 warnings (0.02 sec)

mysql> GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost'
-> WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)

mysql> exit
Bye

# service mysqld restart


You should now have the admin account back and can login to the Plesk control panel

Regards

Phil
 
same problem of Accidently deleted admin on Windows 2008 server

I was wondering if anyone can help me recreating admin for MySQL 5+ under windows 2008 server !!!

ahha, I found a very good response on this link [http://skullboxx.net/kb/node/115]
solved my problem.

Plesk Windows - Reseting the MySql Password

Submitted by Micky on Fri, 04/27/2007 - 23:49 tag(s) : Windows
Once you have logged into the server you via Remote Desktop you will need to take the following steps:

Go to 'Start >> Run' and type in 'services.msc'.
Now you will need to look for 'MySql Server' In the Services window.
Right click on 'MySql Server' and go to 'Properties'.
Once you have copied the location of the 'my.ini' file like the following example you will need to go to 'Start >> Run' and then enter in the location of the 'my.ini' file.
C:\Program Files\SWsoft\Plesk\Databases\MySQL\Data\my.ini

Under the '[mysqld]' section in the 'my.ini' file you will need to add the following line:
skip-grant-tables

Restart 'MySql Server'.
Then you will need to login to MySql:
cd C:\Program Files\SWsoft\Plesk\MySQL\bin

C:\Program Files\SWsoft\Plesk\MySQL\bin>mysql -u admin
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7 to server version: 4.1.18-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.


mysql> use mysql;
mysql> UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> quit;

Then you will need to remove 'skip-grant-tables' from the my.ini file and restart 'MySql' after resaving the my.ini file.
 
Last edited by a moderator:
Back
Top