twitter
    Find out what I'm doing, Follow Me :)

Install PostgreSQL 8.4 on Ubuntu 10.10


PostgreSQL is a database management system relational database and object-oriented free, released under the BSD license.


Installation
To install from Ubuntu to run in console the following line:
sudo apt-get install postgresql postgresql-client pgadmin3
This installs the engine and pgadmin3 client, a graphical tool to manage databases.
The next thing is to change the administrator password system PostgreSQL:
sudo passwd postgres
Now we must change the password of "user postgres" on the engine, it first entered with the following line:
psql -h localhost -U postgres -W template1
and then enter the following command:
ALTER USER postgres WITH PASSWORD 'password';
Finally out of postgres, enter the following command:
\q
With this we have installed PostgreSQL. Settings
We set up remote access to our motor. This step is optional, only if you want to allow access to our server from other hosts.
First we edit the file postgresql.conf:
sudo gedit /etc/postgresql/8.4/main/postgresql.conf
Look for the line:
# Listen_addresses = 'localhost'
and change it to:
listen_addresses = '*'
We also look for the following line:
# Password_encryption = on
and change it to:
password_encryption = on
Now we edit the file "pg_hba.conf"
sudo gedit /etc/postgresql/8.4/main/pg_hba.conf
 
Modify the lines:

# Database administrative login by UNIX sockets
local   all         postgres                          ident

# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# "local" is for Unix domain socket connections only
local   all         all                               ident
# IPv4 remote connections:
host    all         all         194.116.73.46/0          md5
# IPv4 local connections:
host    all         all         127.0.0.1/32          md5
# IPv6 local connections:
host    all         all         ::1/128               md5

We do this to use MD5 authentication with the user postgres.

Finally sent to restart:
sudo /etc/init.d/postgresql-8.4 restart
More information about the configuration: http://www.linux-es.org/node/660

Pgadmin3
The following video shows how to connect to PostgreSQL pgadmin3 and how to use:

0 comments:

Post a Comment