Skip to content

Instantly share code, notes, and snippets.

@richin13
Last active May 17, 2017 16:27
Show Gist options
  • Save richin13/5100bfbf95c8236407efe6b1beb124c2 to your computer and use it in GitHub Desktop.
Save richin13/5100bfbf95c8236407efe6b1beb124c2 to your computer and use it in GitHub Desktop.
Simple steps to have a new user with a database in PostgreSQL/ArchLinux

PostgreSQL setup in ArchLinux

Login as postgres user

$ sudo -u postgres -i

Create PostgreSQL user with login, password and permissions to create new databases

$ createuser -PWdE --interactive

Create database for newly-created user

$ createdb -U <username> <db-name>

Connect to database using newly-created user

$ psql -U <username> -d <db-name>

For more information visit: PostgreSQL - ArchWiki

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