Unable to connect to Postgres DB with prisma

I just installed pgAdmin 4 and created a db, however once I run npx prisma migrate dev I get the error User 'johndoe' was denied access on the database 'db.public'. Here is my database_url: postgresql://user:password@localhost:5432/db?schema=public. I also made sure that special characters have been converted inside % signs. Am I doing something wrong? Is there a specific way I need to create the database? Please help, thankyou.
3 Replies
erik.gh
erik.gh2y ago
you need to grant permissions to user johndoe for accessing the db if you have a psql shell open: GRANT ALL ON [database] TO [user]; this will grant all permissions of a database to a user if you want to narrow it down to just reed and write for example have a look at the pg permissions docs
George
GeorgeOP2y ago
thankyou, is it recommended to use psql when using postgres db, or pgadmin4
erik.gh
erik.gh2y ago
I think they complement not contradict each other
Want results from more Discord servers?
Add your server