1.포스트그레스 설치
sudo apt-get install postgresql
2.비밀번호변경
#접속
#postgre는 기본 root계정
sudo -u postgres psql
#비밀번호 변경
#아래의 프롬프트에서
postgres=#
ALTER USER postgres with encrypted password 'password';
#종료
\q
3.로컬접속 허용
#루트권한으로 변경해야한다.
변경 파일 : postgresql.conf
루트 : /etc/postgresql/9.3/main/
변경 : sudo gedit /etc/postgresql/9.3/main/
#주석제거
#listen_addresses = 'localhost'
-> listen_addresses = 'localhost'
4.접속시 비밀번호 입력 변경
#루트권한으로 변경해야한다.
변경 파일 : pg_hba.conf
루트 : /etc/postgresql/9.3/main/
변경 : sudo gedit /etc/postgresql/9.3/main/pg_hba.conf
# Database administrative login by Unix domain socket
local all postgres peer
-> local all postgres md5
# md5로 권한을 바꾸어 항상 비밀번호를 넣어서 실행시키도록 변경하자.
5.원격접속 허용
변경 파일 : postgresql.conf
listen_addresses = '*'
변경 파일 : pg_hba.conf
# IPv4 local connections:
host all all 127.0.0.1/32 md5
-> host all all 0.0.0.0/0 trust
5.적용
#재시작
sudo /etc/init.d/postgresql restart
혹은
sudo service postgresql restart
6.pgAdmin 설치
sudo apt-get install pgadmin3
#GUI툴로 사용하기 용이하다.
6.데이터베이스 만들기
sudo -u postgres createdb db-name
참조
http://wonzopein.com/45
'기록' 카테고리의 다른 글
우분투 크론탭 crontab path 설정 (0) | 2016.04.03 |
---|---|
Linux 서버 백그라운드 실행 (0) | 2016.03.21 |
우분투 postgres 데이터베이스 백업 복구 (0) | 2016.02.25 |
javascript 이벤트 전파 중단 - 클릭 겹침 해결 (0) | 2016.02.12 |
맥 리눅스 배터리 절약 - TLP설치 (0) | 2016.01.31 |