# How to reset my password in database?

**URL:** <https://forum.openreplay.com/t/how-to-reset-my-password-in-database/113>\
**Category:** Community Guides\
**Created:** [July 5, 2024, 3:56pm UTC](https://forum.openreplay.com/t/how-to-reset-my-password-in-database/113 "2024-07-05T15:56:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dave-the-developer](https://avatars.discourse-cdn.com/v4/letter/d/7ab992/32.png) [@dave-the-developer](https://forum.openreplay.com/u/dave-the-developer)\
**Post date:** [July 5, 2024, 3:56pm UTC](https://forum.openreplay.com/t/how-to-reset-my-password-in-database/113/1 "2024-07-05T15:56:50Z")

</div>

Hello,  
I am running OpenReplay in a VM with no integration with an email provider. How do i reset my credentials via CLI ?

---

<div class="post-metadata">

**Author:** ![mehdi](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.openreplay.com/mehdi/32/50_2.png) [@mehdi](https://forum.openreplay.com/u/mehdi)\
**Post date:** [July 5, 2024, 4:21pm UTC](https://forum.openreplay.com/t/how-to-reset-my-password-in-database/113/2 "2024-07-05T16:21:05Z")

</div>

Follow the below steps to reset the password directly in the database:

1. Run `k9s -n db`
2. Look for a pod called `postgresql**` and press `s`
3. `PGPASSWORD=$POSTGRES_PASSWORD psql -U $POSTGRES_USER -d $POSTGRES_DB`
4. Replace email&password in the first line of this query, and run it:

```auto
WITH a AS (SELECT 'EMAIL@.COM' AS email, 'NEW PASSWORD' AS password)
UPDATE public.basic_authentication
SET password=crypt((SELECT password FROM a), gen_salt('bf', 12))
WHERE user_id = (SELECT user_id
                 FROM public.users
                 WHERE email = (SELECT email FROM a)
                 LIMIT 1)
RETURNING TRUE AS done;

```

1. `\q`
2. `exit`
3. `:quit`
