Skip to content

Instantly share code, notes, and snippets.

@jet10000
Last active August 29, 2015 14:03
Show Gist options
  • Save jet10000/521ebae2c592294537b2 to your computer and use it in GitHub Desktop.
Save jet10000/521ebae2c592294537b2 to your computer and use it in GitHub Desktop.
postgresql
xy@ubuntu:~$ sudo -u postgres psql template1
psql (9.3.4)
Type "help" for help.
template1=# \password postgres
Enter new password:
=============================================
sudo -u postgres psql
postgres-# \list
=============================================
Switch to the postgres user:
sudo su postgres
Execute the postgres createdb command:
createdb --encoding='utf-8' --locale=en_US.utf8 --template=template0;
List the databases from psql:
psql
\l
Quit back to the previous user:
exit
========================================================
pgcli postgres://postgres:pa$$w0rd@localhost:5432/testdb
========================================================
ubuntu@bigdog:~$ sudo netstat -tulpn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment