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?

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?

@rmi21, that command updates your password to pass.


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