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?
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?
3 Answers
Reset to default 3Actually 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 fromhost all all 127.0.0.1/32
tohost all all 192.168.1.1/24
- Restart the postgres service and now everything works as expected.
It's a bug in prisma library itself, has been reported and acknowledged. You can checkout the exact issue here
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.