Here is the guide that I wish were available when I started with PostgreSQL a few years ago.
Getting PostgreSQL
Fedora has a great group install utility for just this occasion.
yum -y groupinstall "PostgreSQL Database"
yum -y install postgresql-contrib
service postgresql initdb
service postgresql start
Quotes and capitalization matter…
Then we proceed to set it up in a useful way.
su postgres
createuser root
(Make this user a superuser)
createuser somebodyelse
(Make this user a superuser also)
exit
psql -c "ALTER USER root WITH PASSWORD 'somepassword'" -d template1
psql -c "ALTER USER somebodyelse WITH PASSWORD 'someotherpassword'" -d template1
vim /var/lib/pgsql/data/pg_hba.conf
(Move to the end of the file and change all of the "ident sameuser" to "md5")
service postgresql restart
Ok, now we move on to installing some helper tools.
yum -y install phpPgAdmin
vim /etc/httpd/conf.d/phpPgAdmin.conf
(Change the order to allow,deny)
(Allow from All)
save/exit
service httpd start
chkconfig httpd on
chkconfig postgresql on
That’s the basics. You now have 2 database admins. You will not be able to log in as root in phpPgAdmin, so log in as the other user.
firefox http://localhost/phpPgAdmin
You will spend the rest of your database life here. Don’t blame me, I just showed you how to do it.
No Comments so far ↓
There are no comments yet...Kick things off by filling out the form below.