[Mac] install postgresql

Published by onesixx on

https://sites.google.com/site/nitinpasumarthy/blog/installingpostgresonmac

 설치

0. 기설치 여부 확인 in Homebrew

Shell

1. Homebrew를 통해 설치

Shell

2. 서비스 시작

Shell

<참고> 다른 방법

Shell

서비가 시작되면 DBeaver…

3. 초기설정

신규 DB 생성

Shell
The files belonging to this database system will be owned by user "onesixx".
This user must also own the server process.

The database cluster will be initialized with locales
COLLATE: C
CTYPE: UTF-8
MESSAGES: C
MONETARY: C
NUMERIC: C
TIME: C
The default database encoding has accordingly been set to "UTF8".
initdb: could not find suitable text search configuration for locale "UTF-8"
The default text search configuration will be set to "simple".

creating directory /usr/local/var/postgres ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

pg_ctl -D /usr/local/var/postgres -l logfile start

혹시 아래와 같이 에러나면..
/usr/local/var/postgres 폴더의 이름을 변경해 준다. 
mv postgres postgres_old

initdb: directory "/usr/local/var/postgres" exists but is not empty
If you want to create a new database system, either remove or empty the directory "/usr/local/var/postgres" or
run initdb with an argument other than "/usr/local/var/postgres".

신규 admin 사용자 추가 (버전폴더<9.6.5>는 다를수 있으니 확인)

Shell

psql에서 default user인  postgres사용자 비밀번호 변경

Shell

<참고> psql 위치 찾기 
~|⇒ locate psql |grep /bin

아래와 같이 ….

Shell

<참고> psql 

Shell

PgAdmin 로 나머지 작업 실행

<참고> psql 그냥 사용하고 싶으면, 

SQL

Categories: Postgresql

onesixx

Blog Owner

guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x