ITeye博客

postgresql install and configure for ubuntu

夜鸣猪 · 2013-04-25 08:13 · Postgresql · 编程语言 · Markdown

ABSTRACT

PostgreSQL is an object-relational database system that has the features of traditional commercial database systems with enhancements to be found in next-generation DBMS systems. This blog entry documents the installation process of the PostgreSQL database on Ubuntu Linux.

 

 

sudo apt-get install postgresql
sudo apt-get install libpq-dev

INTRODUCTION

I have selected PostgreSQL 9.1 and Ubuntu Linux 12.10 32 bit. The installation process follows the apt-get install configure pattern.

STEP 1: VERIFY THAT YOU DO NOT ALREADY HAVE POSTGRESQL INSTALLED ON YOUR SYSTEM

Run the following command in your console:

1

ps ax | grep postgres

If you get a response similar to the one below, then you have PostgreSQL installed.

1

2

3

4

Ss 0:00 postgres: writer process

Ss 0:00 postgres: wal writer process

Ss 0:00 postgres: autovacuum launcher process

Ss 0:00 postgres: stats collector process

STEP 2: INSTALL POSTGRESQL ON YOUR SYSTEM

Run the following commands in your console:

1

2

sudo apt-get update

sudo apt-get install postgresql-9.1

STEP 3: CONFIGURE YOUR POSTGRESQL PASSWORD

1

2

3

sudo -u postgres psql template1

ALTER USER postgres with encrypted password 'your_password';

Press ctrl-d

STEP 4: CONFIGURE MD5 AUTHENTICATION

1

sudo nano /etc/postgresql/9.1/main/pg_hba.conf

Update the

1

local all postgres

entry to

1

local all postgres md5

STEP 5: ENABLE TCP/IP CONNECTIONS

1

sudo nano /etc/postgresql/9.1/main/postgresql.conf

Locate the line

1

#listen_addresses = 'localhost'

and change it to:

1

listen_addresses = 'localhost'

To allow other computers to connect to your PostgreSQL server replace ‘localhost’ with the IP Address of your server, or alternatively to ’0.0.0.0′ to bind to all interfaces.

STEP 6: RESTART POSTGRES

1

sudo service postgresql restart

STEP 7: CONGRATULATIONS! YOU HAVE SUCCESSIVELY INSTALLED POSTGRESQL ON UBUNTU

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。