PostgreSQL (3) 썸네일형 리스트형 DB 생성, 연결, 삭제 Database 생성 CREATE DATABASE test; postgres=# CREATE DATABASE test; CREATE DATABASE postgres=# \l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges -----------+----------+----------+-------------+-------------+----------------------- postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | .. DB 리스트 보는 방법 DB List 보기 \l postgres=# \l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges -----------+----------+----------+-------------+-------------+----------------------- postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | en_US.UTF-8 |.. Postgres 시작하기 [root@localhost ~]# su - postgres 마지막 로그인: 일 10월 6 23:36:35 KST 2019 일시 pts/1 -bash-4.2$ psql -U daniel -d test Password for user daniel: psql (10.10) Type "help" for help. test=# postgresql 위치 확인 which psqlDB 연결 sudo -u postgres psqlDB 연결 끊기, postgresql 쉘에서 빠져나가기 \q \? 여러가지 help를 볼수 있음 - 리눅스 postgres 계정의 패스워드 설정 [root@localhost ~]# passwd postgres 패스워드 입력 [root@localhost ~]# su - postgres 마지막 로.. 이전 1 다음