Score:0

Change postgres password

jp flag

I've forgotten my postgres password for my local install (Ubuntu 20.04).

I have postgres installed and running

henry@henry-Apollo:/$ service postgresql status
● postgresql.service - PostgreSQL RDBMS
     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
     Active: active (exited) since Thu 2021-08-19 18:16:09 BST; 2 days ago
   Main PID: 1924 (code=exited, status=0/SUCCESS)
      Tasks: 0 (limit: 18895)
     Memory: 0B
     CGroup: /system.slice/postgresql.service

Aug 19 18:16:09 henry-Apollo systemd[1]: Starting PostgreSQL RDBMS...
Aug 19 18:16:09 henry-Apollo systemd[1]: Finished PostgreSQL RDBMS.

I'm trying to find pg_hba.conf based on a couple of posts I've seen that explain a process to reset the password.

sudo find / -type d -name "pg_hba.conf"
find: ‘/run/user/1000/doc’: Permission denied
find: ‘/run/user/1000/gvfs’: Permission denied

I cannot find the file. How do I reset the password please.

Thanks

mforsetti avatar
tz flag
Check your systemd service file, and see what you got, e.g. `/lib/systemd/system/postgresql.service`.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.