tehon:~/workspace $ createdb mydb
createdb: could not connect to database template1: could not connect to server: Connection refused
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
mydb라는 데이터 베이스를 생성하고 싶었지만
PostgreSQL 서버가 멈춰있다는 것을 암
tehon:~/workspace $ sudo service postgresql start
* Starting PostgreSQL 9.3 database server p [ OK ]
tehon:~/workspace $ psql
psql (9.3.15)
Type "help" for help.
서버 실행
ubuntu=# createdb mydb서버가 실행된 상태에서 mydb 생성
ubuntu=# \q
\q를 치거나
ctrl+D를 눌러 나옴
tehon:~/workspace $ createdb mydb //?
tehon:~/workspace $ psql mydb
psql (9.3.15)
Type "help" for help.
mydb=#
mydb를 염
이 상태에서 테이블 생성이나 조회등의 작업을 진행함
참고
http://postgresql.kr/docs/9.6/index.html