I’m trying to migrate to Prisma2. I’m trying to in...
# prisma1-community
s
I’m trying to migrate to Prisma2. I’m trying to introspect my Prisma1 MySQL database in local environment. So I deploied my Prisma1's datamodel to local MySQL server but I can’t find the newly created databse. What is the default database name created by Prisma1 with the following docker-compose.yml?
Copy code
version: "3"
services:
  prisma:
    image: prismagraphql/prisma:1.34
    restart: always
    ports:
      - "4466:4466"
    environment:
      PRISMA_CONFIG: |
        port: 4466
        databases:
          default:
            connector: mysql
            host: mysql
            port: 3306
            user: root
            password: password
            database: drcha
  mysql:
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: password
    volumes:
      - mysql:/var/lib/mysql
volumes:
  mysql: ~
n
Hey @Seungsu Kim 👋 the database is typically named after the service name and stage in your
prisma.yml
. Can you share what your
endpoint
looks like in there?
If you don't have the service name and stage specified, the DB name should be
default$default
(or
default*@*default
)
s
My prisma deploy has ran successfully, but if I type
SHOW DATABASES;
in mysql console, there are no DB such as default@default
DATABASE_URL="<mysql://root>:choi3704@localhost:3306/"
this is a endpoint used by Prisma2 client. the databse name part is empy because I don’t know it yet.
@nikolasburk
n
What's your
endpoint
in
prisma.yml
?
s
endpoint: <http://localhost:4466>
this is the endpoint
n
if I type 
SHOW DATABASES;
 in mysql console, there are no DB such as default@default
Hmm that's strange! Can you connect to the MySQL server with a DB client like TablePlus and see if it shows you any existing databases?
Okay, it should be
default@default
in that case, this is explained in the docs here 🙂
s
This is the all databases I’ve got in my local
j
@Seungsu Kim The mysql server is running inside of the docker environment, alongside prisma. If you are running that app against your localhost you will see nothing Remove the database line from your docker compose. Its not needed
If you want to connect to it from outside you have to add
Copy code
ports:
  - "3306:3306"
to your mysql service, and then you can connect to it on that port (not tested, might be mistaken, works for postgresql)