P
Prisma6mo ago
Kal

How can i debug a failed connection?

I'm trying to use prisma to connect to a mariadb database
generator client {
provider = "prisma-client-js"
}

datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}

datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
DATABASE_URL="mysql://apiserver:mypass@localhost:3007/royal_offers"
DATABASE_URL="mysql://apiserver:mypass@localhost:3007/royal_offers"
mypass does not have any special characerts, numbers and letters only I've been stuck on the error
Error: P1001: Can't reach database server at `localhost:3007`
Error: P1001: Can't reach database server at `localhost:3007`
Even though it is online, and reachable with the specified credentials via mysql workbench
3 Replies
Prisma AI Help
Prisma AI Help6mo ago
You decided to hold for human wisdom. We'll chime in soon! Meanwhile, #ask-ai is there if you need a quick second opinion.
Nurul
Nurul6mo ago
As a quick test, can you check if replacing localhost with 127.0.0.1 help? https://github.com/prisma/prisma/issues/5499 Is this occuring on latest prisma version?
GitHub
Prisma can not connect to localhost for MySQL, MariaDB and SQL Se...
Recently our own CI (Github Actions based) pipelines started failing with the following error: P1001 Can't reach database server at localhost:3306 Please make sure your database server is r...
Kal
KalOP6mo ago
it does not, i tried that Also tried another mariadb i have with different host on a standard port

Did you find this page helpful?