파이어맨 이야기

  •  DB Encoding 확인방법
    •  명령어: psql  -U postgres --list
  •  DB 로그인 방법
    •  명령어 : psql [DBNAME] [USERNAME]
    • 위의 명령어를 입력 후 비밀번호를 입력합니다.  


* Postgresql 로컬 접속시 비밀번호 물어보도록 변경

** 설정방법

**# <postgresql config>/pg_hba.conf 를 에디트합니다. 

**# 맨 하단에  접속 설정 부분에 trust를 password로 변경합니다. 


# "local" is for Unix domain socket connections only

local   all             all                                     password

# IPv4 local connections:

host    all             all             127.0.0.1/32            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                                trust

#host    replication     postgres        127.0.0.1/32            trust

#host    replication     postgres        ::1/128                 trust


** 관련 링크 

*** http://www.postgresql.org/docs/9.1/static/auth-pg-hba-conf.html



* DB 백업 명령어

** pg_dump --encoding='UTF8' -U <DBName> <UserName> > <backup file>


* DB 복구 명령어 

** psql -U <DBName> <UserName> < <backup file>


공유하기

facebook twitter kakaoTalk kakaostory naver band