'ubuntu'에 해당되는 글 1건

  1. 2014.03.18 Ubuntu에 PostgreSQL DB 설치

사이트: http://www.postgresql.org


1. 설치

sudo apt-get install postgresql

sudo apt-get install postgresql-doc-9.1

sudo aptget install pgadmin3


2. 설정

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

listen_addresses = 'localhost' --> '*'를 사용하면 외부 접속을 받을 수 있다.

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

# IPv4 local connections:

# host    all             all             127.0.0.1/32            md5

host    all             all             0.0.0.0/0            md5 --> 외부접속을 허용하려면 IP부분을 수정하면 된다.


3. 재시작

sudo /etc/init.d/postgresql restart


4. 기본 사용자(postgre)의 암호 변경

shell로그인: sudo -u postgres psql

ALTER USER postgres encrypted password '암호';

shell종료: \q

shell도움말: \?


5. DB생성 및 접속

sudo -u postgres createdb <db이름>

sudo -u postgres psql <db이름>


Posted by 짱똘애비
,