Monday, August 4, 2014

Quick Postgres Setup Fedora

Reference  links :

https://fedoraproject.org/wiki/PostgreSQL
https://wiki.postgresql.org/wiki/First_steps
https://wiki.postgresql.org/wiki/YUM_Installation
https://community.jboss.org/wiki/InstallPostgreSQLOnFedora?_sscc=t
https://wiki.postgresql.org/wiki/First_steps


sudo yum install postgresql-server postgresql-contrib
journalctl -xn
sudo postgresql-setup initdb
postgresql-setup upgrade
sudo service postgresql start

sudo passwd postgres - set password for user postgres

su -l postgres
"now login to postgres console"
pgsql
"update the password for postgres user"
\password postgres

sudo yum install pgadmin3
sudo vi /var/lib/pgsql/data/pg_hba.conf
"update the entry to support md5 authentication"
host    all             all             127.0.0.1/32            md5
 service postgresql reload

Now open pgadmin clinet tool
And login with to database with
name - postgres
and the password you have set.

Now you may be able to connect from localmachine.
 Since the service runs in 127.0.0.1:5432
If you want to connect from remote machine it should run on 192.* address your local network address. or you external ip address

In this case the postgresal should listen to those ips.You can enable by
editing
 sudo vi /var/lib/pgsql/data/postgresql.conf

and update -
listen_addresses = '*'

 service postgresql reload

sudo firewall-cmd --permanent --add-port=5432/tcp
sudo firewall-cmd --add-port=5432/tcp




No comments: