Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dnovais/c6c6894b95d764be2aca9736436edd0e to your computer and use it in GitHub Desktop.
Save dnovais/c6c6894b95d764be2aca9736436edd0e to your computer and use it in GitHub Desktop.
Fixing error - psql: FATAL: role “postgres” does not exist

Corrigindo o erro psql: FATAL: role “postgres” does not exist

1 - Instalar o postgresql

brew install postgresql

2 - Startar o postgresql

brew services start postgresql

Ao rodar o comando para acessar o postgresql:

psql -U postgres

E o erro for disparado: "psql: FATAL: role “postgres” does not exist"

Para corrigir:

/usr/local/Cellar/postgresql/<version>/bin/createuser -s postgres

ou

/usr/local/opt/postgres/bin/createuser -s postgres

Dessa forma é criado o usuário postgresql e você poderá ter acesso.

@odi89
Copy link

odi89 commented Apr 8, 2024

Thank you!=)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment