-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
32 lines (24 loc) · 778 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
### Install Postgres
See [http://www.yolinux.com/TUTORIALS/LinuxTutorialPostgreSQL.html](tutorial).
sudo apt-get install postgresql
sudo service postgresql start
sudo passwd postgres # set a temp password (e.g. "pass")
su - postgres
#?createuser postgres
createdb ph
service postgresql start # may have to run as root
psql
alter user postgres with password 'pass';
\q
service postgresql stop
service postgresql start
exit
### Use Postgres
su - postgres
psql ph
\l :List databases
\c database-name :Connect to database
\c :Show the database your are connected to
\d :List tables in database
\d table-name :Describe table
SELECT * FROM table-name :List table contents