Skip to content

Instantly share code, notes, and snippets.

@PEKTOP
Last active January 27, 2016 11:03
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 PEKTOP/b201f7254a7e9a7694b4 to your computer and use it in GitHub Desktop.
Save PEKTOP/b201f7254a7e9a7694b4 to your computer and use it in GitHub Desktop.
A Cheat Sheet
POSTGRESQL
$ sudo su postgres -c psql postgres
postgres=# ALTER USER postgres WITH PASSWORD 'password';
postgres=# \q
$ sudo passwd -d postgres
$ sudo su postgres -c passwd
$ adduser tom
$ sudo su postgres -c psql postgres
postgres=# CREATE USER tom WITH PASSWORD 'myPassword';
postgres=# CREATE DATABASE jerry;
postgres=# GRANT ALL PRIVILEGES ON DATABASE jerry to tom;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment