Cannot run 'kong migrations bootstrap' ( Ident authentication failed for user "kong")

2.2k views Asked by At

I'm learning to use Kong. I install it on centos 7. I follow the tutorial from https://docs.konghq.com/install/centos/ I stuck on

kong migrations bootstrap [-c /path/to/kong.conf]

I've already install Postgres on Centos by following this tutorial https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-centos-7

I've also created kong Database and User already

enter image description here

enter image description here

And already execute this command to setup password for kong user

ALTER USER kong WITH PASSWORD 'password';

Here is my kong.conf

pg_host = 127.0.0.1
pg_port = 5432
pg_timeout = 5000
pg_user = kong
pg_password = password
pg_database = kong

When I execute command kong migrations bootstrap -c kong.conf I will get this error

Error: [PostgreSQL error] failed to retrieve PostgreSQL server_version_num: FATAL: Ident authentication failed for user "kong"

I'm wasting my time about 3-4 hours on this. I really need help.

**Edit this is my pg_hba.conf

host    all             all             127.0.0.1/32            md5
host    all             all             ::1/128                 md5

Ps. I've found it somewhere recommended to change it as above from

host    all             all             127.0.0.1/32            ident
host    all             all             ::1/128                ident
1

There are 1 answers

1
Hikaru Shindo On

for IPv4 local connections:

host all all 127.0.0.1/32 trust
host all all 0.0.0.0/0 trust

I made this at its' working !