How to retrieve forgotten Admin password

Please how can a forgotten openemr 5.0.1(7) password be retrieved or reset.

An admin password? Are you able to log in with another account or are you completely locked out?

Thanks for your response. I am completely logged out. No other account has been created yet apart from the admin account.


If you have your db access please execute below command on your OpenEMR database

update users_secure set password = ‘$2a$05$MKtnxYsfFPlb2mOW7Qzq2Oz61S26s5E80Yd60lKdX4Wy3PBdEufNu’ , salt = ‘$2a$05$MKtnxYsfFPlb2mOW7Qzq2b$’ where username = ‘admin’;

once this query got executed successfully your password will be the ‘pass’ for the admin user.

1 Like

How did you install OpenEMR. Are you using xampp?


Thanks Nilesh. I will try it out and revert

I recently upgraded new 7.0 but forgot my admin password. I am running an application inside the docker in AWS lightsail. I tried your code, but it does not work. What is ‘salt’. it is not in the database. Thank you!

1 Like

salt is for older versions

UPDATE users_secure SET `password` = '$2a$05$MKtnxYsfFPlb2mOW7Qzq2Oz61S26s5E80Yd60lKdX4Wy3PBdEufNu' WHERE `username` = 'admin';
1 Like

Hi, what password will this be?[quote=“stephenwaite, post:8, topic:14362, full:true”]
salt is for older versions

UPDATE users_secure SET `password` = '$2a$05$MKtnxYsfFPlb2mOW7Qzq2Oz61S26s5E80Yd60lKdX4Wy3PBdEufNu' WHERE `username` = 'admin';

Hi, what password does this query result in?


As always with any direct updates - make sure you have at least table or record backup to have an option to revert.

The passwords expired… I had no idea that they expiry time and should be changed every 3 months or so… Can you make password that’s more complex than that or assist me with reducing the password requirements.

Thank you