question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error P1010 when running `npx prisma migrate dev` with mysql

See original GitHub issue

Bug description

npx prisma migrate dev throws a P1010 error User "prisma" was denied access on the database "timetracking".

The user however is correctly set up, i have no problems connecting to the db when using dbeaver. Only prisma migrate is acting strange.

How to reproduce

  1. Run npx prisma migrate dev in the project folder

Expected behavior

To be able to run npx prisma migrate devwithout P1010 error when the user is having all the right permissions.

Prisma information

generator client {
    provider = "prisma-client-js"
}

datasource db {
    provider = "mysql"
    url      = env("DATABASE_URL")
}

model User {
    id          String        @id @default(uuid())
    name        String
    createdAt   DateTime      @default(now())
    updatedAt   DateTime      @updatedAt
    TrackedTime TrackedTime[]
}

model TrackedTime {
    id     String    @id @default(uuid())
    start  DateTime  @default(now())
    end    DateTime?
    user   User      @relation(fields: [userId], references: [id])
    userId String
}

DATABASE_URL=mysql://prisma:test@localhost:3306/timetracking

Environment & setup

  • OS: Ubuntu 22.04 Kernel 6.0.9
  • Database: MySQL running as docker container, port 3306 exposed, v8.0.31 or v5.7.40 (makes no difference)
  • Node.js version: 18.12.1

Prisma Version

prisma                  : 4.6.1
@prisma/client          : 4.6.1
Current platform        : debian-openssl-3.0.x
Query Engine (Node-API) : libquery-engine 694eea289a8462c80264df36757e4fdc129b1b32 (at node_modules/@prisma/engines/libquery_engine-debian-openssl-3.0.x.so.node)
Migration Engine        : migration-engine-cli 694eea289a8462c80264df36757e4fdc129b1b32 (at node_modules/@prisma/engines/migration-engine-debian-openssl-3.0.x)
Introspection Engine    : introspection-core 694eea289a8462c80264df36757e4fdc129b1b32 (at node_modules/@prisma/engines/introspection-engine-debian-openssl-3.0.x)
Format Binary           : prisma-fmt 694eea289a8462c80264df36757e4fdc129b1b32 (at node_modules/@prisma/engines/prisma-fmt-debian-openssl-3.0.x)
Format Wasm             : @prisma/prisma-fmt-wasm 4.6.1-3.694eea289a8462c80264df36757e4fdc129b1b32
Default Engines Hash    : 694eea289a8462c80264df36757e4fdc129b1b32
Studio                  : 0.476.0

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
happy1836commented, Nov 23, 2022

This is a totaly different issue, you have problems with openssl. Maybe try upgrading your openssl version and if that doesn’t help open a seperate issue.

update openssl 3.0 on ubuntu 22.04 ,it is running .thank you very much.

1reaction
happy1836commented, Nov 22, 2022

my app has the same problem on ubuntu 2204

Read more comments on GitHub >

github_iconTop Results From Across the Web

migrate deploy: Error: P1010: User `user` was denied access ...
Bug description migrate deploy throws Error: P1010: User user was denied access on the database db.public How to reproduce run migrate ...
Read more >
Error when migrating models to database Prisma
I tried npx prisma migrate save -experimental b/c of a build I saw on youtube. I tried npm install @prisma/cli --save-dev b/c that...
Read more >
Error message reference - Prisma
P1015. "Your Prisma schema is using features that are not supported for the version of the database.
Read more >
Migration troubleshooting in development - Prisma
This guide describes how to resolve issues with Prisma Migrate in a development environment, which often involves resetting your database.
Read more >
Prisma Migrate limitations and known issues
For example, if your migrations are for a PostgreSQL database but you are using a provider is set to mysql : Error: P3014....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found