PostgreSQL 설치




    1.파일 다운
     
    http://yum.pgsqlrpms.org/reporpms/repoview/letter_p.group.html 에 들어가서 OS 및 버전에 맞는 RPM 패키지를 다운받는다.

    2. RPM 패키지를 설치
        rpm -ivh 해당rpm파일명    

    3. SQL Server를 설치
        yum -y install postgresql-server

    4. DB Cluster 생성
        /etc/init.d/postgresql initdb -D /var/lib/pgsql/data               -> 8.4 기준
        /etc/init.d/postgresql-9.0 initdb -D /var/lib/pgsql/9.0/data     -> 9.0 기준

    5. 수정
        vi /var/lib/pgsql/data/postgresql.conf
               listen_address='서버ip'
               port=5432
               max_connections=100

        vi /var/lib/pgsql/data/pg_hba.conf
              host      all      all       0.0.0.0/0      password

    6. DB 생성
        su - postgres
        createdb DB 이름
      # 참고 : DB 생성 전에 postgresql 서비스를 실행 시켜야 한다.
      # 참고 : createdb 위치 8.4 -> /usr/bin/    9.0 -> /usr/pgsql-9.0/bin

    7. 사용자 계정 생성
        su - postgres
        psql DB 이름
        create user 계정명 with password '비밀번호';
        ※ 비밀번호 수정 : alter user 계정명 with password '비밀번호';

    8. 방화벽 포트 변경
      
    PostgreSQL 포트 : TCP 5432 허용 




    Posted by sybd