Lost admin password

My version of Openemr is 6 and patch3 is installed.
I lost my admin password and I am not able to log into openemr as admin.
I have 2factors active, but I have access.
I’ve tried to recover through the database and I couldn’t.
How can I recover my admin password?
Thanks.

hi @rmi21 from a mysql prompt you can reset the password to pass with this command:

UPDATE users_secure SET `password` = '$2a$05$MKtnxYsfFPlb2mOW7Qzq2Oz61S26s5E80Yd60lKdX4Wy3PBdEufNu' WHERE `username` = '<your username>'

where <your username> is probably admin from what you’ve posted

Hi Stephen
I enter my username and what is the password?
Thanks

@rmi21, that command updates your password to pass.

Hi


Does not work

see the SQL tab at the top of phpmyadmin?

Screenshot from 2021-12-22 09-08-25

that’s where you can run the statement

Don’t forget the minimum password length enforcement from globals.
Also check php error log.

re: although that may be only for setting the password.

1 Like

and putting the password in that field is fine @rmi21, you don’t have to run the statement from the SQL tab

@sjpadgett is prob right that’s it’s another security setting


Would it be this way?
I can’t find the global passwordsScreenshot_03

It’s the gbl_minimum_password_length, change that to 4 temporarily. Once back in you can change your password and security settings.


I’ve already changed the gbl_minimum_password_length to 4.
I open SQL as in the image and write this code and run?

yep, that’s right @rmi21 but you need the WHERE clause there at the end

WHERE `username` = 'admin'


Is this correct in the image?
I just need to press the yellow button and that’s it?
Does not work
I can’t log into my admin account

1 Like

Good day.
I am having a similar issue and the enclosed solution is not working.
Is there any other way to reset the passwords?

hi @wannid , it might be another security setting so you should check the log for the error after you receive a failed login.

From when I logged in as user administrator, it said:
failure: ::1. user password is expired

How do I unexpire the password?

When I changed user to admin, it gave the following error:
failure: ::1. user not found in a group

try change globals table password_grace_time to maybe 365