Skip to content

Instantly share code, notes, and snippets.

@Dylan0203
Created September 9, 2017 01:53
Show Gist options
  • Save Dylan0203/f5891ad8617d227b2642d8c2ac80e369 to your computer and use it in GitHub Desktop.
Save Dylan0203/f5891ad8617d227b2642d8c2ac80e369 to your computer and use it in GitHub Desktop.
Install Postgresql to ubuntu

https://askubuntu.com/questions/831292/how-to-install-postgresql-9-6-on-any-ubuntu-version/831293

https://www.postgresql.org/download/linux/ubuntu/

For 14.04

sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main"
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-9.6

Creating user, database, alter password, Granting privileges on database

sudo -u postgres psql

postgres=# CREATE USER <username>;

postgres=# CREATE DATABASE <dbname>;

postgres=# alter <username> oddesign with encrypted password '<password>';

postgres=# grant all privileges on database <dbname> to <username> ;

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-14-04 https://medium.com/coding-blocks/creating-user-database-and-adding-access-on-postgresql-8bfcd2f4a91e

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