Parallel World

Postgresql 유저생성 및 데이터베이스 생성하기 본문

프로그래밍/Linux

Postgresql 유저생성 및 데이터베이스 생성하기

EL_aya 2019. 9. 6. 17:32

Postgresql 유저 생성

Postresql 유저 생성

$ sudo -u postgres createuser <username>

Postgresql 유저 로그인

$ sudo su - postgres

Postgresql 환경에 진입

$ psql
psql (11.5 (Ubuntu 11.5-1.pgdg18.04+1))
Type "help" for help.

postgres=#

유저 패스워드 지정

postgres=# alter user <username> with encrypted password '<password>';

데이터베이스 전체 권한 부여

postgres=# grant all privileges on database <dbname> to <username> ;

데이터베이스 생성하기

데이터베이스 생성

postgres=# CREATE DATABASE <dbname>;

데이터베이스 리스트 확인

postgres=# \list

데이터베이스 삭제

postgres=# DROP DATABASE <dbname>;

 

Comments