# Does the Discourse install set a default postgres password?

**URL:** https://meta.discourse.org/t/does-the-discourse-install-set-a-default-postgres-password/147639
**Category:** Self-hosting
**Created:** [April 11, 2020, 5:26pm UTC](https://meta.discourse.org/t/does-the-discourse-install-set-a-default-postgres-password/147639 "2020-04-11T17:26:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![007](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/007/32/175794_2.png) [@007](https://meta.discourse.org/u/007)
#### Post date: [April 11, 2020, 5:26pm UTC](https://meta.discourse.org/t/does-the-discourse-install-set-a-default-postgres-password/147639/1 "2020-04-11T17:26:30Z")

</div>

Hi, I’m trying to get into the Discourse PostgreSQL database to learn how it’s laid out so I can do some tweaks to the import script to meet my specific needs.

Only problem is that I can’t get into psql in the docker.

When I run: `psql root -h localhost` I am asked for a password.

I’ve tried just hitting ENTER (psql documentation states there is no default password) but I’m told it’s incorrect.

What’s the best practice for accessing the raw database? Or is there a wiki here that shows the database structure? That’s really what I need. I have the [Data Explorer](https://meta.discourse.org/t/32566?silent=true) plugin running, so I could explore from there, but that would be easier to do if I knew how the database is laid out.

Thanks in advance for any help!

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 11, 2020, 7:45pm UTC](https://meta.discourse.org/t/does-the-discourse-install-set-a-default-postgres-password/147639/2 "2020-04-11T19:45:58Z")

</div>

> [@007](#):
>
> Only problem is that I can’t get into psql in the docker.
> 
> When I run: `psql root -h localhost` I am asked for a password.

Try

```plaintext
su postgres
psql

```

---

<div class="post-metadata">

### Author: ![007](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/007/32/175794_2.png) [@007](https://meta.discourse.org/u/007)
#### Post date: [April 11, 2020, 8:36pm UTC](https://meta.discourse.org/t/does-the-discourse-install-set-a-default-postgres-password/147639/3 "2020-04-11T20:36:59Z")

</div>

Thanks! That worked. I also dug into [Data Explorer](https://meta.discourse.org/t/32566?silent=true) a little more and realized I could build my queries from that and didn’t even need direct db access. Helpful to know though.

---

<div class="post-metadata">

### Author: ![Isambard](https://avatars.discourse-cdn.com/v4/letter/i/858c86/32.png) [@Isambard](https://meta.discourse.org/u/Isambard)
#### Post date: [May 26, 2024, 9:29am UTC](https://meta.discourse.org/t/does-the-discourse-install-set-a-default-postgres-password/147639/4 "2024-05-26T09:29:58Z")

</div>

I had the same question. Is there a password, if so, where is this in the configuration?

Is it safe to change the psql user password (e.g. password rotation) and where should the corresponding password be updated in the config?

If running python scripts against a database, it would be helpful to use the same password, otherwise the yml files need to be modified to create a separate database user and password and grant permissions.
