Home > Computers and Internet > postgreSQL on Fedora 16 (설치 및 환경설정)

postgreSQL on Fedora 16 (설치 및 환경설정)

서버설치
# yum install postgresql-sever

pgadmin 설치
# yum install pgadmin3

데이터베이스 생성
# postgresql-setup initdb
(Fedora 16부터 명령어 변경됨. 이전에는 “# service postgresql initdb”)

서비스 시작
# service postgresql start

postgres 계정으로 접속 및 패스워드 설정
# su – postgres
-bash-4.2$ psql postgres
psql (9.1.2)
Type “help” for help.

postgres=# ALTER USER postgres WITH ENCRYPTED PASSWORD ‘사용할 패스워드 문자열’;
postgres=# \q
-bash-4.2$ exit

접근방식 (ident -> password) 및 메모리 사용 설정 변경
# vi /var/lib/pgsql/data/pg_hba.conf
——————————————————————————————-
# TYPE  DATABASE        USER            ADDRESS                 METHOD

# “local” is for Unix domain socket connections only
local   all             all                                     password
# IPv4 local connections:
host    all             all             127.0.0.1/32            password
host    all             all             0.0.0.0/0                  password
# IPv6 local connections:
host    all             all             ::1/128                 password
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            ident
#host    replication     postgres        ::1/128                 ident
——————————————————————————————-

# vi /var/lib/pgsql/data/postgresql.conf
——————————————————————————————-
listen_addresses = ‘*’
port = 5432
max_connections = 100
shared_buffers = 4096MB (이와 같이 설정했을 때 postgresql 서비스가 시작되지 못하는 문제가 발생된다. 원래대로 32MB로 설정할 것)
——————————————————————————————-

서비스 재시작
# service postgresql restart

pgadmin3로 접속 및 작업
# pgadmin3

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: