Install PostgreSQL in Fedora 20

Install Postgres

#> sudo yum install postgresql-server postgresql-contrib
#> sudo postgresql-setup initdb
#> sudo systemctl enable postgresql
#> sudo systemctl start postgresql

Install PgAdmin3

#> sudo yum install pgadmin3

Change/Update Password

#> su - postgres
-bash-4.2$ psql
postgres=# \password postgres
Enter new password: ****
Enter it again: ****

Create user

#> su - postgres
-bash-4.2$ psql
postgres=#CREATE USER myNewUser WITH PASSWORD 'password';

Create DB 

#> su - postgres
-bash-4.2$ psql
postgres=# CREATE DATABASE mydbname OWNER postgres;

Update the authentication method to md5 (required to connect through pgAdmin3 tool)

#> vi /var/lib/pgsql/data/pg_hba.conf

Change the following from peer to md5.

#> # "local" is for Unix domain socket connections only
     local       all                     all                     md5

RESTART the postgreSQL service

Open pgAdmin3 and try to connect with a valid db username/pwd.

Restart the PostgreSQL service

#> sudo systemctl stop postgresql
#> sudo systemctl start postgresql


Reference: https://fedoraproject.org/wiki/PostgreSQL

Comments

Popular posts from this blog

SCTE35 Parser

Dijkstra's Algorithm in JavaScript