I accidentaly deleted admin user. Cannot login.

Forum for questions and support relating to the 1.24.x releases only.
Post Reply
ganomi
Posts: 3
Joined: Fri Feb 19, 2010 11:37 am

I accidentaly deleted admin user. Cannot login.

Post by ganomi » Fri Feb 19, 2010 11:40 am

Hi.

I was playing with users and accidentally deleted last admin account. Now I am not able to login.

How can I create new account? (maybe directly in mysql?)

I guess the system should not let to delete last admin account.

Thanks for help.

mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Post by mastertheknife » Fri Feb 19, 2010 11:47 am

Hi. You can re-create the admin account by running this query into MySQL. you can use phpmyadmin or the mysql executeable.
The password for the admin below is "changepassword"

Code: Select all

INSERT INTO `Users` (`Id`, `Username`, `Password`, `Language`, `Enabled`, `Stream`, `Events`, `Control`, `Monitors`, `Devices`, `System`, `MaxBandwidth`, `MonitorIds`) VALUES
(1, 'admin', '*3B34B40DAE3DD1E15943B37622F688A6D7F8002D', 'en_gb', 1, 'View', 'Edit', 'Edit', 'Edit', 'Edit', 'Edit', '', '');

ganomi
Posts: 3
Joined: Fri Feb 19, 2010 11:37 am

Post by ganomi » Fri Feb 19, 2010 11:51 am

Thank you!

whatboy
Posts: 304
Joined: Mon Aug 31, 2009 10:31 pm

Post by whatboy » Fri Feb 19, 2010 10:34 pm

I guess the USER should not delete last admin account.

:lol:

mysterylectricity
Posts: 18
Joined: Sat Jan 07, 2017 2:09 am

Re: I accidentaly deleted admin user. Cannot login.

Post by mysterylectricity » Fri Feb 17, 2017 2:32 am

This worked for me as well. For those of you who are not familiar with using mysql, the following commands are prerequisite:

Code: Select all

mysql -u root -p
Enter password:
If you have not set an explicit password for mysql, the system root password worked for me.

Then select the zm database:

Code: Select all

use zm;
and then:

Code: Select all

INSERT INTO `Users` (`Id`, `Username`, `Password`, `Language`, `Enabled`, `Stream`, `Events`, `Control`, `Monitors`, `Devices`, `System`, `MaxBandwidth`, `MonitorIds`) VALUES
(1, 'admin', '*3B34B40DAE3DD1E15943B37622F688A6D7F8002D', 'en_gb', 1, 'View', 'Edit', 'Edit', 'Edit', 'Edit', 'Edit', '', '');
This will set the default login to admin and the default password to changepassword.

The changes take effect immediately. Change your password and add another privileged user in case you make the same mistake again.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests