Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAccess denied for user '***'@'%' to database 'prisma' #4520
Comments
|
Can you please share your docker-compose file(redact any sensitive information)? For first error is related to specifying a schema property in the MySQL or Mongo connector which is not supported by them as there is no concept of schema in those database servers. So this issue will be a duplicate of https://github.com/prisma/prisma/issues/4434 For the second issue, please make sure that the user you are using to connect prisma to your database has sufficient right for the creation of new databases and it can also read the existing one. In the above error, Prisma is trying to connect to the "prisma" database which it uses to store metadata information about the datamodel and the migrations that it has applied. Make sure your user has those permissions. |
|
Can you give more info about the "prisma" database?I need to convince my backend to allow me to connect to his database via prisma. Whether prisma will affect their existing services. I want to know the specific process of prisma connecting to an existing database. Can you give me some links to resources that contain this information?Thanks. |
|
"prisma" database stores metadata information about the migrations performed on the server. It also stores some internal tokens. It is not documented as it is an implementation detail. Basically, we query that database and apply the migration accordingly. So please give your user access to this database so that prisma can work correctly. |
|
@pantharshit00 |
|
It was a legacy feature that we still need to support for compatibility. You can generate the cluster token using |
Is the 'prisma' database just that?
|
|
It is the management schema in postgres. You have two services and the management schema which stores metadata about them |
There is no such schema by default in postgres |
|
I have solution: CREATE DATABASE prisma; ALTER USER testuser CREATEDB -- switch to database "prisma" -- GRANT CONNECT ON DATABASE prisma TO testuser; Now it works for me. Could you specify somewhere in documentation, that user must have permission to create database? |
|
Yes. cc @nikolasburk |
|
�I only want to query the existing database. Can I adjust the configuration of the Prisma and connect to the Prisma with lower permission? I can't get the root access to the database. |
|
User should have permission for the creation of the database so that it can create the database for your service. You can also predict the database name that you will need permission for by looking at the URL in your prisma.yml file. For example: So if you on MySQL database name will be On postgres, we will create a schema called |
@pantharshit00 |



Describe the bug
When the elevated database user account does not have permission to create a schema, it cannot establish a connection with an existing database.
But when I provided the root account, I successfully established a connection with the database, but prisma created a schema called prisma.

Look like this:
To Reproduce
Steps to reproduce the behavior:
Exception in thread "main" java.lang.RuntimeException: Unable to load Prisma config: com.prisma.config.InvalidConfiguration: Only Postgres connectors specify a schema. If they do they also need to specify a database. Other connectors only specify a database.Exception in thread "main" java.sql.SQLSyntaxErrorException: (conn=8356231) Access denied for user 'nuggets'@'%' to database 'prisma'Expected behavior
why prisma created a database called prisma in my mysql server. Is there a way to not create this database? What is the role of this database?
Versions (please complete the following information):
I am using Prisma CLI version prisma/1.32.2 node-v11.10.1 on macOS 10.13.6