# Cannot Log In Using Admin account

**URL:** <https://discourse.cakephp.org/t/cannot-log-in-using-admin-account/4210>\
**Category:** Need Help\
**Created:** [April 23, 2018, 6:56pm UTC](https://discourse.cakephp.org/t/cannot-log-in-using-admin-account/4210 "2018-04-23T18:56:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![EclipseMold](https://avatars.discourse-cdn.com/v4/letter/e/f04885/32.png) [@EclipseMold](https://discourse.cakephp.org/u/EclipseMold)\
**Post date:** [April 23, 2018, 6:56pm UTC](https://discourse.cakephp.org/t/cannot-log-in-using-admin-account/4210/1 "2018-04-23T18:56:35Z")

</div>

Major issue here. I cannot log in with my admin account today. I have 2 other user accounts doing the same thing yet everyone else is fine. Is there a way through PHPmyadmin that I can reset the password or create another admin user? I’m really stuck.

Thanks for any help.

PS - I’m a newbie when it comes to this.

---

<div class="post-metadata">

**Author:** ![Graziel](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Graziel](https://discourse.cakephp.org/u/Graziel)\
**Post date:** [April 23, 2018, 8:36pm UTC](https://discourse.cakephp.org/t/cannot-log-in-using-admin-account/4210/2 "2018-04-23T20:36:12Z")

</div>

1. create new user, remember password
2. go to PHPmyadmin
3. copy your new user hashed password
4. paste it into your old user
5. delete new user
6. login using new user password on your old account

---

<div class="post-metadata">

**Author:** ![EclipseMold](https://avatars.discourse-cdn.com/v4/letter/e/f04885/32.png) [@EclipseMold](https://discourse.cakephp.org/u/EclipseMold)\
**Post date:** [April 25, 2018, 5:22pm UTC](https://discourse.cakephp.org/t/cannot-log-in-using-admin-account/4210/3 "2018-04-25T17:22:31Z")

</div>

How do I create a new user in step 1 if I can’t log into my application to do so? I can log into PHPmyadmin right now and that is all.

I also don’t know what you mean by my “new user hashed password”.

Thank you.

---

<div class="post-metadata">

**Author:** ![Graziel](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Graziel](https://discourse.cakephp.org/u/Graziel)\
**Post date:** [April 25, 2018, 6:55pm UTC](https://discourse.cakephp.org/t/cannot-log-in-using-admin-account/4210/4 "2018-04-25T18:55:18Z")

</div>

i dont know how your app creates new user - registration? in shell? some other way? maybe you have some account you know password to?

> I also don’t know what you mean by my “new user hashed password”.

if you have typical database you will have `users` table and `password` field in it, usually passwords are hashed so noone will know what it is cause its suppose to be secret to everyone but user.

---

<div class="post-metadata">

**Author:** ![EclipseMold](https://avatars.discourse-cdn.com/v4/letter/e/f04885/32.png) [@EclipseMold](https://discourse.cakephp.org/u/EclipseMold)\
**Post date:** [April 25, 2018, 7:12pm UTC](https://discourse.cakephp.org/t/cannot-log-in-using-admin-account/4210/5 "2018-04-25T19:12:30Z")

</div>

Okay, you are referring to the encrypted string in the password field. I’m on board now. Do you know what kind of encryption is used? Maybe I can find an encrypting tool that can create the hash out of my password and I can paste that in there?

---

<div class="post-metadata">

**Author:** ![Graziel](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Graziel](https://discourse.cakephp.org/u/Graziel)\
**Post date:** [April 25, 2018, 8:51pm UTC](https://discourse.cakephp.org/t/cannot-log-in-using-admin-account/4210/6 "2018-04-25T20:51:54Z")

</div>

you can try to use cake console:  
in shell `bin/cake console`  
and there  
`echo (new Cake\Auth\DefaultPasswordHasher())->hash('test')`

---

<div class="post-metadata">

**Author:** ![EclipseMold](https://avatars.discourse-cdn.com/v4/letter/e/f04885/32.png) [@EclipseMold](https://discourse.cakephp.org/u/EclipseMold)\
**Post date:** [April 26, 2018, 1:48pm UTC](https://discourse.cakephp.org/t/cannot-log-in-using-admin-account/4210/7 "2018-04-26T13:48:48Z")

</div>

[root@intranet cake]# echo (new Cake\Auth\DefaultPasswordHasher())-\>hash(‘test’)  
-bash: syntax error near unexpected token `new’

This is what I get when I run it.

---

<div class="post-metadata">

**Author:** ![Graziel](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Graziel](https://discourse.cakephp.org/u/Graziel)\
**Post date:** [April 26, 2018, 3:26pm UTC](https://discourse.cakephp.org/t/cannot-log-in-using-admin-account/4210/8 "2018-04-26T15:26:57Z")

</div>

your php in cli is probably older version, try to put it temporary in index.php or some page you can see just to copy result

or you can try to see if you can change php version in cli (shell)
