Skip to content

Instantly share code, notes, and snippets.

@B1Z0N
Last active February 20, 2022 15:32
Show Gist options
  • Save B1Z0N/0d03a2b6dfb7fdca3efeaa9802f443d8 to your computer and use it in GitHub Desktop.
Save B1Z0N/0d03a2b6dfb7fdca3efeaa9802f443d8 to your computer and use it in GitHub Desktop.
Postgres setup
  1. Install postgres.
  2. Setup password for postgres linux user: sudo passwd postgres
  3. Switch to this user: su - postgres
  4. Run psql -U postgres
  5. Create user with your name as in linux. Grant it some privileges. For all privileges:
CREATE USER {your_username} WITH ENCRYPTED PASSWORD '{your_password}';
ALTER USER {your_username} WITH SUPERUSER;
  1. Login to your linux user account and run psql to login as you.

P.S. the thing is that postgres allows only the linux users with the same name as postgres users to login.

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