Hi guys, quick question - I have access to a datab...
# orm-help
a
Hi guys, quick question - I have access to a database in a MySQL box that I want to have Prisma introspecting/connecting to, but don't have access to make new databases. However, it seems as though Prisma needs to make a new database called 'prisma' to store its metadata. Is there any way to change this or redirect the tables it needs to create to the database I do have access to?
r
It shouldn't need a new database - it should use your existing one..
a
it seems as though it tried to make a new database called 'prisma' to store its own metadata
the error is
Exception in thread "main" java.sql.SQLSyntaxErrorException: (conn=4316845) Access denied for user '****'@'%' to database 'prisma'
and it's cased by a database creation query: `Query is: CREATE SCHEMA IF NOT EXISTS
prisma
DEFAULT CHARACTER SET latin1;`
r
What is your connection string in your
schema.prisma
file - that should determine the database it uses
a
are you talking about prisma-schema.js? when i run
prisma init
I don't see a build file called schema.prisma
i've specified a host, database, user, and pass in my docker-compose.yml file. It connects to the database, that's not the issue. If I try doing the same thing in Docker instead of on a production MySQL box, I see that it generated a 'prisma' database when starting up
is there a way to not have to do that?
r
Hey @Ashwin Kudva đź‘‹ You are using Prisma 1, I guess it will need a user that has full access to the database, the one that you pass in your
docker-compose.yml
. Other than that, it doesn’t create a new db. Could you share your
docker-compose.yml
a
Sure
I am using Prisma 1, and unfortunately I cannot have a user create a database. Is this something that can be avoided if I migrate to Prisma 2?
r
Full access to the database, not access to creating one. You can create the db and pass into your
docker-compose.yml
and just pass the user credentials with full access just to the created database.