Error connecting to existing database using external MySQL - How to rename of the default prisma database?

prisma

#1

Hello :slight_smile:

[Prisma 1.34, MySQL]

Is it possible to change the name of the default prisma database? Prisma creates it when I execute the docker-compose up -d command

I have noted on my local (testing on xampp, MariaDB) that prisma logs into my database and creates a database called 'prisma' where it holds some metadata. I would like to change this name, for example, to ‘myprefix_prisma’.

My hosting throws a bug (when docker-compose up -d), because I have no right to create a new database without a prefix. I thought if I had created such a base before (I must have a prefix) it would be good.

Exception in thread "main" java.sql.SQLSyntaxErrorException: (conn = 1501100) Access denied for user 'user_prisma'@'xxx.xxx.xxx.xxx' to database 'prisma'
…
Query is: CREATE SCHEMA IF NOT EXISTSprismaDEFAULT CHARACTER SET latin1;

docker-compose.yml

version: '3'
services:
  prisma:
    image: prismagraphql/prisma:1.34
    restart: always
    ports:
    - "4466:4466"
    environment:
      PRISMA_CONFIG: |
        port: 4466
        # uncomment the next line and provide the en var var PRISMA_MANAGEMENT_API_SECRET = my-secret to activate cluster security
        # managementApiSecret: my-secret
        databases:
          default:
            connector: mysql
            host: 'host.com'
            database: 'my_dbprisma'
            user: 'user_prisma'
            password: 'pass'
            # rawAccess: true
            # ssl: true
            port: '3306'
            migrations: true

The default prisma database looks like this:

default%20prisma%20database