Last active
August 29, 2015 14:03
-
-
Save jet10000/521ebae2c592294537b2 to your computer and use it in GitHub Desktop.
postgresql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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