prisma can't connect to postgres database "user was denied access"

prisma can't connect to my local postgresql database even though the user I connect with is the owner of the database...
27 Replies
سَيـْـــــــــــــــــفُ اللهِ
.env file:
DATABASE_URL="postgresql://toji@localhost:5432/aladb"
DATABASE_URL="postgresql://toji@localhost:5432/aladb"
proof this user can actually connect to the db:
سَيـْـــــــــــــــــفُ اللهِ
if anyone can help quickly I've been stuck on this for a week
Nurul
Nurul4mo ago
Your connection string should look something like:
DATABASE_URL="postgresql://username:password@localhost:5432/aladb"
DATABASE_URL="postgresql://username:password@localhost:5432/aladb"
Can you try this format? It looked like password field was missing in your connection string
سَيـْـــــــــــــــــفُ اللهِ
that's because it had no password @Nurul (Prisma) for the sake of argument, is there some command I can use to get the password for this user? or is it just the login password for the user on the system I mean is the users's password on postgresql the same as system login pass or different because I didn't set a specific password for this user in postgres
Yetzederixx
Yetzederixx4mo ago
You'll want to set a password for that user
Yetzederixx
Yetzederixx4mo ago
ALTER USER user_name WITH PASSWORD 'new_password';
Nurul
Nurul4mo ago
It's recommended to have a password, can you try setting the password with the above SQL command and pass it in the connection string and check? Let us know in case you still get the same error.
سَيـْـــــــــــــــــفُ اللهِ
@Nurul (Prisma) @Yetzederixx
سَيـْـــــــــــــــــفُ اللهِ
I just tried this also doesn't work
Nurul
Nurul4mo ago
Are you able to connect to this database via a GUI tool like TablePlus or PgAdmin?
Yetzederixx
Yetzederixx4mo ago
I have a feeling that user may not actually have permissions on the table and/or db if you have multiple db's on the server
Yetzederixx
Yetzederixx4mo ago
Stack Overflow
PostgreSQL: Show all the privileges for a concrete user
How to make a query to the Postgres data dictionary to find out all the privileges that a particular user has. I've been looking for a solution and I can not find anything. Thanks and good day
سَيـْـــــــــــــــــفُ اللهِ
I think I do have permissions I don't have any gui tools but I can connect to it using psql like this:
سَيـْـــــــــــــــــفُ اللهِ
the schema permissions line from the stack overflow post shows nothing though
No description
Yetzederixx
Yetzederixx4mo ago
I strongly recommend this tool for db administration. https://dbeaver.io/download/
Serge
DBeaver Community
Download
Want results from more Discord servers?
Add your server