728x90
반응형
#############################################################
#
# Title : postgresql 8.3.6 source version install for RadHat9 (Success)
# date : 2009.02.26
# Lee Tae Young
#
#############################################################
#참고 글
#http://ttongfly.net/zbxe/?mid=database&sort_index=regdate&order_type=desc&page=2&document_srl=45368
#http://blog.naver.com/northshore?Redirect=Log&logNo=30033589147
#http://cafe.naver.com/nipponit.cafe?iframe_url=/ArticleRead.nhn%3Farticleid=662
#압축풀기
tar xvfj postgresql-8.3.6.tar.bz2
cd postgresql-8.3.6
#인스톨
./configure --help
./configure --prefix=/usr/local/pgsql --enable-nls=UTF8 --without-readline --without-zlib --with-perl
make
make install
#group, user 생성
groupadd postgres
useradd -g postgres postgres
passwd postgres
su - postgres
vi .bash_profile
-------------------------
export PG=/usr/local/pgsql
export PATH=$PATH:$PG/bin
export MANPATH="$MANPATH":$PG/man
export PGLIB=$PG/lib
export PGDATA=$PG/data
-------------------------
source .bash_profile
exit
#data 디렉토리 생성
cd /usr/local/pgsql
mkdir data
chown -R postgres:postgres /usr/local/pgsql/
#데이터베이스를 초기화
su - postgres
cd /usr/local/pgsql
./initdb --encoding=UTF8 -D /usr/local/pgsql/data/
#데이터베이스를 가동
./postmaster -D /usr/local/pgsql/data/ &
ps ax|grep post
./psql template1
###################################################################################
Welcome to psql 7.3.2, the PostgreSQL interactive terminal.
Type: copyright for distribution terms
h for help with SQL commands
? for help on internal slash commands
g or terminate with semicolon to execute query
q to quit
template1=#
# 안해도 된다....#######################################################################
우선은 postgres 의 패스워드를 변경하고 postgresql 을 패스워드 모드로 작동하게 하겠습니다.
postgresql 은 기본적으로 아무 사용자가 접근가능한 모드로 작동이 되더군요.이유는 모르겠습니다.
제가 잘못 안 것일 수도 있고..--a..
패스워드를 먼저 변경하도록 하지요.
template1=# alter user postgres with password '1234';
ALTER USER
template1=# select*from pg_user;
usename | usesysid | usecreatedb | usesuper | usecatupd | passwd | valuntil | useconfig
----------+----------+-------------+----------+-----------+----------+----------+-----------
postgres | 1 | t | t | t | ******** | |
(1 row)
template1=#
###################################################################################
#일단 빠져나온 후 /usr/local/pgsql/data 폴더로 이동하여 pg_hba.conf 파일을 열어서 아래의 내용을 바꿉니다.
cd /usr/local/pgsql/data/
vi pg_hba.conf
###################################################################################
#원격접속용세팅
서버에 직접접속하지 않고 원격으로 데이터베이스에 접근하기 위해서 다음의 세팅이 필요합니다.
/usr/local/pgsql/data/postgresql.conf
-------------------------
listen_addresses = '*'
port = 5432
-------------------------
/usr/local/pgsql/data/pg_hba.conf
-------------------------
host postgres postgres <IP주소> <인증방식>
-------------------------
###################################################################################
#postgresql 재구동
cd ../bin
./pg_ctl restart -D /usr/local/pgsql/data/
./psql template1
728x90
반응형