# Unable to change ADMIN password

**URL:** <https://community.open-emr.org/t/unable-to-change-admin-password/9062>\
**Category:** Day-to-Day Users\
**Created:** [September 28, 2017, 4:38am UTC](https://community.open-emr.org/t/unable-to-change-admin-password/9062 "2017-09-28T04:38:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![visolveemr](https://community.open-emr.org/user_avatar/community.open-emr.org/visolveemr/32/10974_2.png) [@visolveemr](https://community.open-emr.org/u/visolveemr)\
**Post date:** [September 28, 2017, 4:38am UTC](https://community.open-emr.org/t/unable-to-change-admin-password/9062/1 "2017-09-28T04:38:43Z")

</div>

@Renay Dutkiewicz,

With reference to your post [https://sourceforge.net/p/openemr/discussion/202505/thread/e83bbeb9/?limit=25#681c](https://sourceforge.net/p/openemr/discussion/202505/thread/e83bbeb9/?limit=25#681c)

I am currently locked out of OPENEMR  
with the ADMIN user. I attempted the following to reset, however, i am  
still unable to login to the OpenEMR.

Copied from the FAQ…  
"What do I do if I am locked out of OpenEMR?  
If you are locked out of OpenEMR, there are two possible options.

If the administrator can login, then the administrator can change the users password in OpenEMR at Administrators-\>Users.

If the administrator can not login, then it is more difficult. To do  
this, need to modify the administrator’s entry in the users\_secure mysql  
table. Will need to set the ‘password’ and ‘salt’ for the selected  
‘username’ on the mysql entry. Will need to set ‘password’ to  
$2a$05$NX3JhLZcQv9vCsWVn2GDT.24dclmvOqmM61VG.QigyShrJm4ssQTq and set  
‘salt’ to $2a$05$NX3JhLZcQv9vCsWVn2GDTM$ . The administrator will now be  
able to login into OpenEMR with the password ‘pass’.(after doing this,  
do recommend then changing the password in OpenEMR at  
Administration-\>Users to something more secure)"

---

<div class="post-metadata">

**Author:** ![visolveemr](https://community.open-emr.org/user_avatar/community.open-emr.org/visolveemr/32/10974_2.png) [@visolveemr](https://community.open-emr.org/u/visolveemr)\
**Post date:** [September 28, 2017, 4:41am UTC](https://community.open-emr.org/t/unable-to-change-admin-password/9062/2 "2017-09-28T04:41:10Z")

</div>

Hello Renay Dutkiewicz,

We assume, the hashed password and salt that you are using is from the older version of OpenEMR.  
Try the following values to update users\_secure table.

update users\_secure set password = ‘$2a$05$MKtnxYsfFPlb2mOW7Qzq2Oz61S26s5E80Yd60lKdX4Wy3PBdEufNu’ , salt = ‘$2a$05$MKtnxYsfFPlb2mOW7Qzq2b$’ where id = ‘ADMIN USER ID’;

The administrator will now be able to login into OpenEMR with the password ‘pass’.  
After successful login, you can change the password. Hope this will help you.  
Please let us know if you have any other clarifications.

Thanks,  
[ViSolve](http://www.visolve.com/hc/)

---

<div class="post-metadata">

**Author:** ![brady.miller](https://community.open-emr.org/user_avatar/community.open-emr.org/brady.miller/32/10178_2.png) [@brady.miller](https://community.open-emr.org/u/brady.miller)\
**Post date:** [September 28, 2017, 7:41am UTC](https://community.open-emr.org/t/unable-to-change-admin-password/9062/3 "2017-09-28T07:41:51Z")

</div>

thanks @visolveemr ,  
Guessing the old combo was prior to a fix in the auth stuff we needed to do several years back. I’ll update the wiki FAQ.  
-brady

---

<div class="post-metadata">

**Author:** ![Sam99](https://community.open-emr.org/letter_avatar_proxy/v4/letter/s/53a042/32.png) [@Sam99](https://community.open-emr.org/u/Sam99)\
**Post date:** [October 23, 2017, 11:51pm UTC](https://community.open-emr.org/t/unable-to-change-admin-password/9062/4 "2017-10-23T23:51:00Z")

</div>

I have tried all the suggestions still unabel to unlock

---

<div class="post-metadata">

**Author:** ![Sam99](https://community.open-emr.org/letter_avatar_proxy/v4/letter/s/53a042/32.png) [@Sam99](https://community.open-emr.org/u/Sam99)\
**Post date:** [October 23, 2017, 11:51pm UTC](https://community.open-emr.org/t/unable-to-change-admin-password/9062/5 "2017-10-23T23:51:57Z")

</div>

`update users_secure set password = '$2a$05$MKtnxYsfFPlb2mOW7Qzq2Oz61S26s5E80Yd60lKdX4Wy3PBdEufNu' , salt = '$2a$05$MKtnxYsfFPlb2mOW7Qzq2b$’ where id = ‘ADMIN USER ID';`

The administrator will now be able to login into OpenEMR with the password ‘pass’.  
After successful login, you can change the password. Hope this will help you.  
Please let us know if you have any other clarifications.

I have tried all the suggestions still unabel to unlock  
Please Help

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [October 24, 2017, 12:27am UTC](https://community.open-emr.org/t/unable-to-change-admin-password/9062/6 "2017-10-24T00:27:46Z")

</div>

the below query allowed login as admin with pass from a mysql prompt if you replace ADMIN USER ID with the id which is probably 1

or you could use

```
where username = 'admin';

```

if that was the username

```
mysql>

update users_secure set password = '$2a$05$MKtnxYsfFPlb2mOW7Qzq2Oz61S26s5E80Yd60lKdX4Wy3PBdEufNu' , salt = '$2a$05$MKtnxYsfFPlb2mOW7Qzq2b$' where id = 'ADMIN USER ID';

```

`Query OK, 2 rows affected (0.03 sec)`  
`Rows matched: 2 Changed: 2 Warnings: 0`

---

<div class="post-metadata">

**Author:** ![visolveemr](https://community.open-emr.org/user_avatar/community.open-emr.org/visolveemr/32/10974_2.png) [@visolveemr](https://community.open-emr.org/u/visolveemr)\
**Post date:** [October 24, 2017, 4:32am UTC](https://community.open-emr.org/t/unable-to-change-admin-password/9062/7 "2017-10-24T04:32:18Z")

</div>

Hello @Sam99,  
The query should work with no issue like how @stephenwaite as mentioned.  
Please let us know if you receive any error message or warning while query execution. If yes, could you share a screen shot of the same.  
If not, then as a next steps we may need to check the ACL tables.

Thanks,  
[ViSolve](http://www.visolve.com/hc/openemr)

---

<div class="post-metadata">

**Author:** ![Jeremiah\_Ocasio](https://community.open-emr.org/user_avatar/community.open-emr.org/jeremiah_ocasio/32/11926_2.png) [@Jeremiah\_Ocasio](https://community.open-emr.org/u/Jeremiah_Ocasio)\
**Post date:** [October 24, 2017, 10:09pm UTC](https://community.open-emr.org/t/unable-to-change-admin-password/9062/9 "2017-10-24T22:09:56Z")

</div>

Ive reset admin user pass via sql to ‘1a1dc91c907325c69271ddf0c944bc72’ and then flushed privileges and reloaded the whole server. Its still not allowing login with the “pass” as expected. Is there a chance the settings for force secure password being enabled is blocking me from access?

---

<div class="post-metadata">

**Author:** ![visolveemr](https://community.open-emr.org/user_avatar/community.open-emr.org/visolveemr/32/10974_2.png) [@visolveemr](https://community.open-emr.org/u/visolveemr)\
**Post date:** [October 25, 2017, 4:34am UTC](https://community.open-emr.org/t/unable-to-change-admin-password/9062/11 "2017-10-25T04:34:59Z")

</div>

Hello @Jeremiah_Ocasio,

1. If you are not able to login into mysql kindly refer this link to change or reset your password - [https://www.howtoforge.com/setting-changing-resetting-mysql-root-passwords](https://www.howtoforge.com/setting-changing-resetting-mysql-root-passwords)

2. If you are not able to login into openemr and you are getting the following error “Invalid username or password”. Try the following steps,

i) Get the admin user id from users table using the following query.

```
 select id from users where username = 'ADMIN USER NAME';

```

ii) From that admin user id using the following query update the users\_secure table.

update users\_secure set password = ‘$2a$05$MKtnxYsfFPlb2mOW7Qzq2Oz61S26s5E80Yd60lKdX4Wy3PBdEufNu’ , salt = ‘$2a$05$MKtnxYsfFPlb2mOW7Qzq2b$’ where id = ‘ADMIN USER ID’;

The administrator will now be able to login into OpenEMR with the password ‘pass’. After successful login, you can change the password. Hope this will help you.

Please let us know if you have any other clarifications.

Thanks,  
[ViSolve](http://www.visolve.com/hc/openemr)

---

<div class="post-metadata">

**Author:** ![Jeremiah\_Ocasio](https://community.open-emr.org/user_avatar/community.open-emr.org/jeremiah_ocasio/32/11926_2.png) [@Jeremiah\_Ocasio](https://community.open-emr.org/u/Jeremiah_Ocasio)\
**Post date:** [November 14, 2017, 7:35pm UTC](https://community.open-emr.org/t/unable-to-change-admin-password/9062/12 "2017-11-14T19:35:33Z")

</div>

Hello Visolveemr,

I found that resetting the password was done but not valid as it did not meet the systems settings for password strength. After going in and updating password requirements to minimal I was able to reset it via SQL as I used to and then get into system and update from GUI.

Thanks for the reply to this one and hope this helps future issues for resetting when password strength is an issue.

---

<div class="post-metadata">

**Author:** ![Sam99](https://community.open-emr.org/letter_avatar_proxy/v4/letter/s/53a042/32.png) [@Sam99](https://community.open-emr.org/u/Sam99)\
**Post date:** [November 15, 2017, 4:09am UTC](https://community.open-emr.org/t/unable-to-change-admin-password/9062/13 "2017-11-15T04:09:31Z")

</div>

Jeremiah\_Ocasio9h  
Hello Visolveemr,

I found that resetting the password was done but not valid as it did not meet the systems settings for password strength. After going in and updating password requirements to minimal I was able to reset it via SQL as I used to and then get into system and update from GUI.  
Can you please Guide me step by step I am still having this problem  
Thanks

---

<div class="post-metadata">

**Author:** ![Sam99](https://community.open-emr.org/letter_avatar_proxy/v4/letter/s/53a042/32.png) [@Sam99](https://community.open-emr.org/u/Sam99)\
**Post date:** [November 15, 2017, 4:09am UTC](https://community.open-emr.org/t/unable-to-change-admin-password/9062/14 "2017-11-15T04:09:59Z")

</div>

> [@Sam99](#):
>
> Can you please Guide me step by step I am still having this problem
> 
> Thanks

Can you please Guide me step by step I am still having this problem  
Thanks

---

<div class="post-metadata">

**Author:** ![visolveemr](https://community.open-emr.org/user_avatar/community.open-emr.org/visolveemr/32/10974_2.png) [@visolveemr](https://community.open-emr.org/u/visolveemr)\
**Post date:** [November 15, 2017, 4:23am UTC](https://community.open-emr.org/t/unable-to-change-admin-password/9062/15 "2017-11-15T04:23:33Z")

</div>

@Jeremiah_Ocasio ,

Currently, OpenEMR doesn’t have password strength validation feature.The above suggestion was given to reset the user’s password through MySQL .

We will have password strength validation feature in upcoming OpenEMR versions.

[ViSolve](http://www.visolve.com/hc/openemr)

---

<div class="post-metadata">

**Author:** ![Sam99](https://community.open-emr.org/letter_avatar_proxy/v4/letter/s/53a042/32.png) [@Sam99](https://community.open-emr.org/u/Sam99)\
**Post date:** [November 15, 2017, 4:32am UTC](https://community.open-emr.org/t/unable-to-change-admin-password/9062/16 "2017-11-15T04:32:30Z")

</div>

Thanks for I mean in my SQL if you can share the screenshot where i will make this change  
Thanks

---

<div class="post-metadata">

**Author:** ![visolveemr](https://community.open-emr.org/user_avatar/community.open-emr.org/visolveemr/32/10974_2.png) [@visolveemr](https://community.open-emr.org/u/visolveemr)\
**Post date:** [November 15, 2017, 4:53am UTC](https://community.open-emr.org/t/unable-to-change-admin-password/9062/17 "2017-11-15T04:53:24Z")

</div>

@Sam99,

Steps to be followed :

1.Login to MySQL using your credentials  
2.Select OpenEMR database to which you want reset user’s password

Get the admin user id from users table using the following query.  
3.select id from users where username = ‘ADMIN USER NAME’;

From that admin user id using the following query update the users\_secure table.  
4.update users\_secure set password =  
‘$2a$05$MKtnxYsfFPlb2mOW7Qzq2Oz61S26s5E80Yd60lKdX4Wy3PBdEufNu’ , salt =  
‘$2a$05$MKtnxYsfFPlb2mOW7Qzq2b$’ where id = ‘ADMIN USER ID’;

The administrator will now be able to login into OpenEMR with the  
password ‘pass’.

Kindly refer the attached screen shot .

 ![password reset](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/f/f1d3e42954f53753f5ea67340aee2f972985b0fa.png)

Thanks,  
[ViSolve](http://www.visolve.com/hc/openemr)

---

<div class="post-metadata">

**Author:** ![Sam99](https://community.open-emr.org/letter_avatar_proxy/v4/letter/s/53a042/32.png) [@Sam99](https://community.open-emr.org/u/Sam99)\
**Post date:** [November 15, 2017, 5:26am UTC](https://community.open-emr.org/t/unable-to-change-admin-password/9062/18 "2017-11-15T05:26:33Z")

</div>

Hi visolveemr  
Can i share my screen ?? with you on team view?

---

<div class="post-metadata">

**Author:** ![Sam99](https://community.open-emr.org/letter_avatar_proxy/v4/letter/s/53a042/32.png) [@Sam99](https://community.open-emr.org/u/Sam99)\
**Post date:** [November 15, 2017, 5:27am UTC](https://community.open-emr.org/t/unable-to-change-admin-password/9062/19 "2017-11-15T05:27:04Z")

</div>

i am using My sql 3.2

---

<div class="post-metadata">

**Author:** ![visolveemr](https://community.open-emr.org/user_avatar/community.open-emr.org/visolveemr/32/10974_2.png) [@visolveemr](https://community.open-emr.org/u/visolveemr)\
**Post date:** [November 21, 2017, 9:00am UTC](https://community.open-emr.org/t/unable-to-change-admin-password/9062/20 "2017-11-21T09:00:17Z")

</div>

@Sam99,

What is the error you are getting when you try to reset the password ?  
Is it possible to share the screen shot of the error message ?

Thanks,  
[ViSolve](http://www.visolve.com/hc/fhirehr)

---

<div class="post-metadata">

**Author:** ![Ashu\_Kurkure](https://community.open-emr.org/user_avatar/community.open-emr.org/ashu_kurkure/32/14909_2.png) [@Ashu\_Kurkure](https://community.open-emr.org/u/Ashu_Kurkure)\
**Post date:** [August 28, 2020, 12:24am UTC](https://community.open-emr.org/t/unable-to-change-admin-password/9062/21 "2020-08-28T00:24:03Z")

</div>

This was very helpful. Thanks.

---

<div class="post-metadata">

**Author:** ![stephengreen](https://community.open-emr.org/letter_avatar_proxy/v4/letter/s/b38774/32.png) [@stephengreen](https://community.open-emr.org/u/stephengreen)\
**Post date:** [January 11, 2021, 5:20pm UTC](https://community.open-emr.org/t/unable-to-change-admin-password/9062/22 "2021-01-11T17:20:13Z")

</div>

I was locked out of my new 6.0 upgrade and tried this solution, but I get an error saying there is no ‘salt’ field in the table. Was the table structure changed for 6.0, and is there another way to change the ADMIN password for 6.0?

[Next page](https://community.open-emr.org/t/unable-to-change-admin-password/9062.md?page=2)
