-
Notifications
You must be signed in to change notification settings - Fork 7
Postgres SQL
alochym01 edited this page May 5, 2018
·
4 revisions
- version 9.6
- yum install -y epel-release
- yum install -y https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
- yum install -y postgresql96-server net-tools
- Initialize
- /usr/pgsql-9.6/bin/postgresql96-setup initdb
- Configuration Postgres SQL config file
- vi /var/lib/pgsql/9.6/data/pg_hba.conf
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all ident
# IPv4 local connections:
host all all 127.0.0.1/32 md5
- Startup
- systemctl start postgresql-9.6.service
- Start up at boot time
- systemctl enable postgresql-9.6.service
- Common CLI
- Create user
- postgres# CREATE USER "freeswitch" WITH PASSWORD 'password';
- Create database
- postgres# CREATE DATABASE freeswitch;
- Grant privileges
- postgres# grant all privileges on database freeswitch to freeswitch;
- Testing login to Postgres SQL
- [hadn@localhost ~]$ psql -d freeswitch -U freeswitch -W -h 127.0.0.1