Error P1010 when running `npx prisma migrate dev` with mysql
See original GitHub issueBug 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
- Run
npx prisma migrate dev
in the project folder
Expected behavior
To be able to run npx prisma migrate dev
without 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:
- Created 10 months ago
- Comments:7
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
update openssl 3.0 on ubuntu 22.04 ,it is running .thank you very much.
my app has the same problem on ubuntu 2204