Professional Documents
Culture Documents
5 | Unixmen
Install PostgreSQL
First, add the PostgreSQL repository depending upon your server architecture.
For 32bit:
For 64bit:
For other distros, head over to the following link and install the relevant repository.
http://www.unixmen.com/install-postgresql-9-3-phppgadmin-centos-6-5/ 1/9
7/22/2014 How To Install PostgreSQL 9.3 And phpPgAdmin In CentOS 6.5 | Unixmen
yum update
Then, start postgresql service and make it to start automatically on every reboot.
/etc/init.d/postgresql-9.3 start
chkconfig postgresql-9.3 on
vi /etc/sysconfig/iptables
su - postgres
psql
http://www.unixmen.com/install-postgresql-9-3-phppgadmin-centos-6-5/ 2/9
7/22/2014 How To Install PostgreSQL 9.3 And phpPgAdmin In CentOS 6.5 | Unixmen
psql (9.3.4)
Type "help" for help.
postgres=#
su - postgres
$ createuser senthil
Create database:
$ createdb mydb
Set password and Grant access to the database mydb for senthil:
$ psql
http://www.unixmen.com/install-postgresql-9-3-phppgadmin-centos-6-5/ 3/9
7/22/2014 How To Install PostgreSQL 9.3 And phpPgAdmin In CentOS 6.5 | Unixmen
psql (9.3.4)
Type "help" for help.
su - postgres
Enter command:
$ dropdb <database-name>
$ dropuser <user-name>
vi /var/lib/pgsql/9.3/data/pg_hba.conf
[...]
# TYPE DATABASE USER ADDRESS METHOD
/etc/init.d/postgresql-9.3 restart
vi /var/lib/pgsql/9.3/data/postgresql.conf
[...]
#listen_addresses = 'localhost'
[...]
#port = 5432
[...]
Uncomment both lines and set the IP address of your postgresql server or set * to listen from all
clients as shown below:
listen_addresses = '*'
port = 5432
/etc/init.d/postgresql-9.3 restart
phpPgAdmin is available only in PostgreSQL RPM repository. If you didnt add PostgreSQL repository,
you should add EPEL repository.
http://www.unixmen.com/install-postgresql-9-3-phppgadmin-centos-6-5/ 5/9
7/22/2014 How To Install PostgreSQL 9.3 And phpPgAdmin In CentOS 6.5 | Unixmen
yum update
phpPgAdmin is case sensitive. Use upper and lower cases as shown in the above command.
By default, you can access phppgadmin usinghttp://localhost/phpPgAdmin from your local system
only. To access remotely, do the following.
vi /etc/httpd/conf.d/phpPgAdmin.conf
Configure phpPgAdmin
open the file /etc/phpPgAdmin/config.inc.php:
vi /etc/phpPgAdmin/config.inc.php
http://www.unixmen.com/install-postgresql-9-3-phppgadmin-centos-6-5/ 6/9
7/22/2014 How To Install PostgreSQL 9.3 And phpPgAdmin In CentOS 6.5 | Unixmen
$conf['servers'][0]['host'] = '';
$conf['servers'][0]['host'] = 'localhost';
$conf['extra_login_security'] = true;
$conf['extra_login_security'] = false;
$conf['owned_only'] = false;
$conf['owned_only'] = true;
Save and close the file. Restart postgresql service and Apache services.
/etc/init.d/postgresql-9.3 restart
service httpd restart
Now open your browser and navigate to http://ip-address/phpPgAdmin. You will be pleased
when you see the following screen.
http://www.unixmen.com/install-postgresql-9-3-phppgadmin-centos-6-5/ 7/9
7/22/2014 How To Install PostgreSQL 9.3 And phpPgAdmin In CentOS 6.5 | Unixmen
Login with users that youve created earlier. I already have created a user called senthil with
password centos before, so I log in with user senthil.
http://www.unixmen.com/install-postgresql-9-3-phppgadmin-centos-6-5/ 8/9
7/22/2014 How To Install PostgreSQL 9.3 And phpPgAdmin In CentOS 6.5 | Unixmen
Thats it. Now youll able to perform create, delete and alter databases graphically using phpPgAdmin
easily.
http://www.unixmen.com/install-postgresql-9-3-phppgadmin-centos-6-5/ 9/9