user616
user616

Reputation: 855

Prism V2 access denied to postgres database

I have created a brand new nodejs project with Prism2 and Postgres 13

Postgres is on a windows VM in the same network. Im testing Prism for the first time and cannot get it to deploy the database schema at all. I cant find anything that tells me how to fix this problem.

When i run npx prisma migrate dev all i get is Error: P1010: User 'johndoe' was denied access on the database 'db.public'. Ive searched for this error message and cant find any resolution, what is the issue here?

Upvotes: 2

Views: 9069

Answers (3)

Damodar
Damodar

Reputation: 1

SOLVED:: i was facing the same issue ,i resolved it by allowing the connection through different path like unix socket ,ipv4 and ipv6 authentication method to "trust"in pg_hba.conf of pgsql in /var/lib.And finally restarting the postgresql service.

Upvotes: 0

r_dmr
r_dmr

Reputation: 193

It's a bug in prisma library itself, has been reported and acknowledged. You can checkout the exact issue here

Upvotes: 0

user616
user616

Reputation: 855

Actually the problem was resolved with some changes to the Postgres config files. By default its only listening to the local IP address of the machine that its installed on. With help from this post i was able to resolve the issue.

  • Made sure that the postgresql.conf listen_addresses was set to '*'. This was correct by default.
  • Made sure the pg_hba.conf IPv4 host was set within the range of my network. This was changed from host all all 127.0.0.1/32 to host all all 192.168.1.1/24
  • Restart the postgres service and now everything works as expected.

Upvotes: 3

Related Questions