Skip to content

Instantly share code, notes, and snippets.

@cedricbonhomme
Last active June 10, 2019 09:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cedricbonhomme/8075bc20e527a43317fb47c034bc553f to your computer and use it in GitHub Desktop.
Save cedricbonhomme/8075bc20e527a43317fb47c034bc553f to your computer and use it in GitHub Desktop.
Creation of a PostgreSQL database
sudo -u postgres createuser <username>
sudo -u postgres createdb <database>
sudo -u postgres psql
psql (11.2 (Ubuntu 11.2-1))
Type "help" for help.
postgres=# alter user <username> with encrypted password '<password>';
ALTER ROLE
postgres=# grant all privileges on database <database> to <username>;
GRANT
postgres=#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment