Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user: postgres
- password: postgres
- host: 192.168.99.100
- port: 5432
- database: test_db
- var pg = require('pg');
- var conString =
- "postgres://postgres:postgres@192.168.99.100:5432/test_db";
- var client = new pg.Client(conString);
- client.connect();
- psql -U postgres -d test_db -h 192.168.99.100 -W
- # 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 postgres trust
- #host replication postgres 127.0.0.1/32 trust
- #host replication postgres ::1/128 trust
- host all all all md5
- #------------------------------------------------------------------------------
- # CONNECTIONS AND AUTHENTICATION
- #------------------------------------------------------------------------------
- # - Connection Settings -
- listen_addresses = '*' # comma-separated list of addresses;
- # defaults to 'localhost'; use '*' for all
- # (change requires restart)
- #port = 5432 # (change requires restart)
- max_connections = 100 # (change requires restart)
- #superuser_reserved_connections = 3 # (change requires restart)
- #unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
- # (change requires restart)
- #unix_socket_group = '' # (change requires restart)
- #unix_socket_permissions = 0777 # begin with 0 to use octal notation
- # (change requires restart)
- #bonjour = off # advertise server via Bonjour
- # (change requires restart)
- #bonjour_name = '' # defaults to the computer name
- # (change requires restart)
- # - Security and Authentication -
- #authentication_timeout = 1min # 1s-600s
- #ssl = off # (change requires restart)
- #ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers
- # (change requires restart)
- #ssl_prefer_server_ciphers = on # (change requires restart)
- #ssl_ecdh_curve = 'prime256v1' # (change requires restart)
- #ssl_cert_file = 'server.crt' # (change requires restart)
- #ssl_key_file = 'server.key' # (change requires restart)
- #ssl_ca_file = '' # (change requires restart)
- #ssl_crl_file = '' # (change requires restart)
- #password_encryption = on
- #db_user_namespace = off
- #row_security = on
- # GSSAPI using Kerberos
- #krb_server_keyfile = ''
- #krb_caseins_users = off
- # - TCP Keepalives -
- # see "man 7 tcp" for details
- #tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds;
- # 0 selects the system default
- #tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds;
- # 0 selects the system default
- #tcp_keepalives_count = 0 # TCP_KEEPCNT;
- # 0 selects the system default
- host all all all md5
- host all all 0.0.0.0/0 md5
- host all all 192.168.0.0/16 md5
- host all all 172.17.0.0/16 md5
- host all all 192.168.99.0/24 md5
- host all all 0.0.0.0/0 md5
- docker pull postgres
- docker run --name pg -p 5432:5432 -e POSTGRES_PASSWORD=passwrd -e POSTGRES_USER=root -e POSTGRES_DB=dse -d postgres
- docker exec -ti pg /bin/bash
- psql -U root -d dse -h 192.168.99.100 -W
- Password for user root:
- psql (9.6.2)
- Type "help" for help.
- dse=#
- var pg = require('pg');
- var conString = "postgres://root:passwrd@192.168.99.100/dse";
- var client = new pg.Client(conString);
- client.connect();
- node connect.js
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement