ошибка создания базы данных PostgreSQL vuerecipe_development: наберите tcp 127.0.0.1:5432: соединение: соединение отклонено - PullRequest
0 голосов
/ 17 июня 2019

Для платформы Buffalo golang мне нужно создать базу данных postgres:

marco@pc01:~/go/src/vuerecipe$ buffalo db create -a
v4.11.1

[POP] 2019/06/17 15:27:09 info - create vuerecipe_development   
(postgres://postgres:postgres@127.0.0.1:5432  
/vuerecipe_development?sslmode=disable)
Error: couldn't create database vuerecipe_development: error creating 
PostgreSQL database vuerecipe_development: dial tcp 127.0.0.1:5432: 
connect: connection refused
Usage:
  buffalo-pop pop create [flags]

Flags:
  -a, --all    Creates all of the databases in the database.yml
  -h, --help   help for create

Global Flags:
  -c, --config string   The configuration file you would like to use.
  -d, --debug           Use debug/verbose mode
  -e, --env string      The environment you want to run migrations 
against. Will use $GO_ENV if set. (default "development")
  -p, --path string     Path to the migrations folder (default 
"./migrations")

couldn't create database vuerecipe_development: error creating 
PostgreSQL database vuerecipe_development: dial tcp 127.0.0.1:5432: 
connect: connection refused
Usage:
  buffalo db [flags]

Aliases:
  db, db

Flags:
  -h, --help   help for db

Следуя подсказкам и инструкциям, найденным в ответах на этот вопрос: Не удается подключиться к Postgresql через порт 5432- StackOverflow

Я остановил службу postgresql:

marco@pc01:~/go/src/vuerecipe$ sudo systemctl stop postgresql.service

Я изменил адрес прослушивания в /etc/postgres/11/main/postgresql.conf:

listen_addresses = '*'

И добавил в конец /etc/postgres/qq/main/pg_hba.conf следующие три строки:

host    all             all             0.0.0.0/0               md5
host    all             all             ::/0                    md5
host    all             all             192.168.1.7/32          md5

И перезапустил службу postgresql:

marco@pc01:~/go/src/vuerecipe$ sudo systemctl start postgresql.service

Но проблема сохраняется:

marco@pc01:~/go/src/vuerecipe$ buffalo db create -a
v4.11.1

[POP] 2019/06/17 15:46:39 info - create vuerecipe_development  
(postgres://postgres:postgres@127.0.0.1:5432  
/vuerecipe_development?sslmode=disable)
Error: couldn't create database vuerecipe_development: error creating 
PostgreSQL database vuerecipe_development: dial tcp 127.0.0.1:5432: 
connect: connection refused
Usage:
  buffalo-pop pop create [flags]

Любые советы и предложения по решению проблемы подключения к базе данных PostgreSQL?

С нетерпением ждем вашей любезной помощи.Marco

Брандмауэр неактивен:

marco@pc01:~/go/src/vuerecipe$ sudo ufw status
Status: inactive

РЕШЕНО: Прочитав этот пост: https://askubuntu.com/questions/50621/cannot-connect-to-postgresql-on-port-5432 Я удалил свою предыдущую установку postgres-11 и переустановил ее снова.

...