Skip to content

Instantly share code, notes, and snippets.

@philographer
Created May 25, 2017 07:19
Show Gist options
  • Select an option

  • Save philographer/fff6924f422e77786825b567b2d653af to your computer and use it in GitHub Desktop.

Select an option

Save philographer/fff6924f422e77786825b567b2d653af to your computer and use it in GitHub Desktop.
Postgres

Postgres

Postgres

sudo passwd root => 관리자 패스워드 설정

sudo su postgres => postgres 라는 이름으로 로그인

sudo visudo -f /etc/sudoers => postgres 계정 추가

sudo -i -u postgres => postgres계정으로 명령어 실행(-u) => -i 사용자 환경으로 실행

createuser --interactive

설치경로/data 폴더에 있는 postgresql.conf 파일과 pg_hba_conf 파일을 수정을 해주셔야 합니다

GRANT ALL PRIVILEGES ON TABLE users TO yuhogyun;

su(SUbstitude) 계정 변경

psql => psql켬

createuser hogyun -d -u (-d => db만들기, -u => 슈퍼유저)

CREATE DATABASE restroomdb; (대문자로 쳐야함)

\dt => 데이타베이스

sudo adduser yuhogyun sudo passwd postgres

psql initdb -D 이름 chmod

\d 테이블 리스트 \du 유져 리스트



$ createdb restroom
$ dropdb ‘restroom’

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-14-04

psql --host=restroomdb.ctabe3wb6pkc.ap-northeast-2.rds.amazonaws.com --port=5432 --username=yuhogyun --password --dbname=restroomdb

http://stackoverflow.com/questions/26066029/postgresql-password-being-asked-for-and-not-working-despite-re-installation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment