· 8 years ago · May 20, 2018, 10:48 PM
1docker-entrypoint-initdb.d/createdatabase.sql:
2
3DROP DATABASE IF EXISTS mydb;
4DROP ROLE IF EXISTS myrole;
5CREATE ROLE myrole WITH LOGIN;
6CREATE DATABASE mydb WITH OWNER myrole;
7GRANT ALL PRIVILEGES ON DATABASE mydb TO myrole;
8\c mydb myrole localhost
9DROP TABLE IF EXISTS sometable;
10
11psql:/docker-entrypoint-initdb.d/createdatabase.sql:6: \connect: could not connect to server: Connection refused
12 Is the server running on host "localhost" (127.0.0.1) and accepting
13 TCP/IP connections on port 5432?
14could not connect to server: Network unreachable
15 Is the server running on host "localhost" (::1) and accepting
16 TCP/IP connections on port 5432?