# Can't login with initial user

**URL:** <https://community.open-emr.org/t/cant-login-with-initial-user/16099>\
**Category:** Management and Administration\
**Created:** [February 19, 2021, 8:07pm UTC](https://community.open-emr.org/t/cant-login-with-initial-user/16099 "2021-02-19T20:07:53Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Filipe\_Aguiar](https://community.open-emr.org/user_avatar/community.open-emr.org/filipe_aguiar/32/15502_2.png) [@Filipe\_Aguiar](https://community.open-emr.org/u/Filipe_Aguiar)\
**Post date:** [February 19, 2021, 8:07pm UTC](https://community.open-emr.org/t/cant-login-with-initial-user/16099/1 "2021-02-19T20:07:53Z")

</div>

I’ve successfully installed OpenEMR 6.0.0 following the instructions on the site with no errors.

I’ve noted aside the initial username and password. But I’m getting _invalid username or password_ when trying to login. The apache log gives no errors. What could it be?

---

<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:** [February 19, 2021, 8:10pm UTC](https://community.open-emr.org/t/cant-login-with-initial-user/16099/2 "2021-02-19T20:10:21Z")

</div>

hi @Filipe_Aguiar, do you have access to the database? could query the log table

eek, it’s all encrypted, if you can get to an sql prompt can reset with

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

```

---

<div class="post-metadata">

**Author:** ![Filipe\_Aguiar](https://community.open-emr.org/user_avatar/community.open-emr.org/filipe_aguiar/32/15502_2.png) [@Filipe\_Aguiar](https://community.open-emr.org/u/Filipe_Aguiar)\
**Post date:** [February 19, 2021, 9:30pm UTC](https://community.open-emr.org/t/cant-login-with-initial-user/16099/3 "2021-02-19T21:30:10Z")

</div>

I have access to the database, yes.

My username is **administrador** and I ran the query you’ve passed. Since you didn’t say what password it would reset to I tried the combination of **administrador** /_pass_, **administrador** /_password_, **administrador** /_admin_ and the problem persists.

---

<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:** [February 19, 2021, 9:40pm UTC](https://community.open-emr.org/t/cant-login-with-initial-user/16099/4 "2021-02-19T21:40:45Z")

</div>

that query would update a username of `admin` and best to keep the hashed password which equates to `pass` so adjust the username accordingly so guessing

```auto
UPDATE users_secure SET `password` = '$2a$05$MKtnxYsfFPlb2mOW7Qzq2Oz61S26s5E80Yd60lKdX4Wy3PBdEufNu' WHERE `username` = 'administrador'
```

---

<div class="post-metadata">

**Author:** ![Filipe\_Aguiar](https://community.open-emr.org/user_avatar/community.open-emr.org/filipe_aguiar/32/15502_2.png) [@Filipe\_Aguiar](https://community.open-emr.org/u/Filipe_Aguiar)\
**Post date:** [February 19, 2021, 10:17pm UTC](https://community.open-emr.org/t/cant-login-with-initial-user/16099/5 "2021-02-19T22:17:02Z")

</div>

Yeah. I’ve changed the username in the query accordingly. In fact I verified and the current password hash is set to **$2a$05$MKtnxYsfFPlb2mOW7Qzq2Oz61S26s5E80Yd60lKdX4Wy3PBdEufNu**. And yet I can’t login.

---

<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:** [February 20, 2021, 8:45am UTC](https://community.open-emr.org/t/cant-login-with-initial-user/16099/6 "2021-02-20T08:45:43Z")

</div>

Check out the log table in openemr database (the comments column will store where the login broke down). Encryption of this field is not turned on by default in 6.0.0, but if the fields are encrypted, let us know, since there is then a simple global that can be changed in database to disable that.

---

<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:** [February 20, 2021, 8:50am UTC](https://community.open-emr.org/t/cant-login-with-initial-user/16099/7 "2021-02-20T08:50:14Z")

</div>

ack, even though it’s not encrypted, the comments column will be base64 encoded making this tougher to look through. could find the login entry (in event column) and then copy the comments into a base64 decoder to see the message (as an aside, it is base64 encoded to deal with binary data on query logging).

---

<div class="post-metadata">

**Author:** ![Filipe\_Aguiar](https://community.open-emr.org/user_avatar/community.open-emr.org/filipe_aguiar/32/15502_2.png) [@Filipe\_Aguiar](https://community.open-emr.org/u/Filipe_Aguiar)\
**Post date:** [February 20, 2021, 11:56am UTC](https://community.open-emr.org/t/cant-login-with-initial-user/16099/8 "2021-02-20T11:56:50Z")

</div>

The decrypted text is as follows:  
_failure: 177.79.83.242. user not in any phpGACL groups_

---

<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:** [February 20, 2021, 6:08pm UTC](https://community.open-emr.org/t/cant-login-with-initial-user/16099/9 "2021-02-20T18:08:43Z")

</div>

hi,

looks like this type of bug may be cropping up again:  
[MySQL 8 broken - Not able to login after installation · Issue #2870 · openemr/openemr · GitHub](https://github.com/openemr/openemr/issues/2870)

you can get your instance working with a:

```auto
INSERT INTO `gacl_groups_aro_map` (`group_id`, `aro_id`) VALUES ('11', '10');

```

Are you using mysql or mariadb? which version?

---

<div class="post-metadata">

**Author:** ![sjpadgett](https://community.open-emr.org/user_avatar/community.open-emr.org/sjpadgett/32/21623_2.png) [@sjpadgett](https://community.open-emr.org/u/sjpadgett)\
**Post date:** [February 20, 2021, 6:25pm UTC](https://community.open-emr.org/t/cant-login-with-initial-user/16099/10 "2021-02-20T18:25:41Z")

</div>

I’ve seen this before when the Gacl silently fails on an upgrade. Not sure on install but usually running sql\_upgrade fixed for me.

---

<div class="post-metadata">

**Author:** ![Filipe\_Aguiar](https://community.open-emr.org/user_avatar/community.open-emr.org/filipe_aguiar/32/15502_2.png) [@Filipe\_Aguiar](https://community.open-emr.org/u/Filipe_Aguiar)\
**Post date:** [February 20, 2021, 6:44pm UTC](https://community.open-emr.org/t/cant-login-with-initial-user/16099/11 "2021-02-20T18:44:13Z")

</div>

It didn’t work for me unfortunately. I had to reinstall it. Now it’s working. I’ll mark this as a solution, but if you guys could improve it I think it would be great.

---

<div class="post-metadata">

**Author:** ![sjpadgett](https://community.open-emr.org/user_avatar/community.open-emr.org/sjpadgett/32/21623_2.png) [@sjpadgett](https://community.open-emr.org/u/sjpadgett)\
**Post date:** [February 20, 2021, 6:55pm UTC](https://community.open-emr.org/t/cant-login-with-initial-user/16099/12 "2021-02-20T18:55:34Z")

</div>

Sometimes the gacl will fail and we may not notice the error being displayed. Happened to me several times. However, we’ll certainly keep an eye open for future.  
Be safe…

---

<div class="post-metadata">

**Author:** ![casper](https://community.open-emr.org/user_avatar/community.open-emr.org/casper/32/21481_2.png) [@casper](https://community.open-emr.org/u/casper)\
**Post date:** [January 20, 2025, 6:22pm UTC](https://community.open-emr.org/t/cant-login-with-initial-user/16099/13 "2025-01-20T18:22:23Z")

</div>

Hi @brady.miller can you please help me i also have a similar issue on “Invalid username or password” i already run the command “select \* from log order by date desc limit 10;” and decode the result i see it was due to  
“user not found in a group” i try to run the “INSERT INTO `gacl_groups_aro_map` (`group_id`, `aro_id`) VALUES (‘11’, ‘10’);”. and get an error " `Duplicate entry '11-10' for key 'gacl_groups_aro_map.PRIMARY'`".

Thanks  
Rey
