#catatan #postgresql
PostgreSQL How to (for Windows)
Open cmd (right click run as Administrator)
$ cd "C:\Program Files\PostgreSQL\10\bin" (enter)
PostgreSQL How to (for MacOS and Linux)
Open terminal, then type:
$ cd /Applications/Postgres.app/Contens/Versions/10/bin (enter) for MacOS
$ cd /var/lib/postgresql/~version~/bin (enter) for Linux Debian and Ubuntu
$ cd /usr/lib/postgresql/~version~/bin (enter) for Linux Debian 10 and later
$ cd /var/lib/pgsql/~version~/bin (enter) for Linux CentOS
InitDB (First time only)
$ pg_ctl initdb -D "..\data" (enter)
Cek status db
$ pg_ctl status -D "..\data" (enter)
Stop database
$ pg_ctl stop -D "..\data" (enter)
Run/Start database
$ pg_ctl start -D "..\data" (enter)
### ### ### ### ###
Config of postgresql.conf
* Edit listen_addresses = 'localhost' to listen_addresses = '*'
* Remove # symbol from #port = 5432, it would be like this port = 5432
Config of pg_hba.conf
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all trust
host replication all 127.0.0.1/32 trust
host replication all ::1/128 trust
host all all 0.0.0.0/0 trust
host all postgres 127.0.0.1/32 trust
host all postgres ::1/128 trust
host all postgres 0.0.0.0/0 trust
Source :
https://www.postgresql.org/download
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
https://www.enterprisedb.com/download-postgresql-binaries
https://postgresapp.com
https://postgresapp.com/downloads.html
https://postgresapp.com/documentation
https://stackoverflow.com/questions/36155219/psql-command-not-found-mac/36156782
https://wiki.postgresql.org/wiki/Installers/Mac_OS_X#Known_Installers
https://stackoverflow.com/questions/42653690/psql-could-not-connect-to-server-no-such-file-or-directory-5432-error/50882756
https://stackoverflow.com/questions/3004523/postgresql-database-default-location-on-linux
https://askubuntu.com/questions/385416/pg-ctl-command-not-found-what-package-has-this-command
Comments
Post a Comment