-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_postgresql.sh
46 lines (27 loc) · 1.07 KB
/
setup_postgresql.sh
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
33
34
35
36
37
38
39
40
41
sudo yum install postgresql postgresql-server postgresql-devel postgresql-contrib postgresql-docs
sudo service postgresql initdb
sudo vim /var/lib/pgsql9/data/pg_hba.conf
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all power_user 0.0.0.0/0 md5
host all other_user 0.0.0.0/0 md5
host all storageLoader 0.0.0.0/0 md5
# IPv6 local connections:
host all all ::1/128 md5
$ sudo vim /var/lib/pgsql9/data/postgresql.conf
#listen_addresses = 'localhost' # what IP address(es) to listen on;
listen_addresses='*'
#port = 5432
port = 5432
$ sudo service postgresql start
# Log into the server:
$ sudo su - postgres
$ psql -U postgres
CREATE USER power_user SUPERUSER;
$ psql -U postgres #enter a db
# get all users
psql=# \du
# get all DATABASE
psql=# \l