-
QuestionIn my basic Next.js13 project, I'm using Prisma ORM to interact with MySQL Server 8.2 instance set up locally at port 3306.
Upon running the command:
I get the error below:
I ensured everytime the root password eneterd in ther URL is correct. ======== To ensure that MySQL server is up and running and listening at port 3306 , I've checked bunch of things that prove that the server is indeed up at port 3306. Most evident out of all those checks is the creation of a dummy database DBSampleDB using SQL Command Line and then creating a dummy table Test_Table with 2 columns (id, name) using 2 different IDEs: DataGrip (JetBeans) and DBeaver after TestConnection got passed using both the IDEs. Snips below: ============= Can this be a compatibility issue between versions of Prisma (5.5.2) and MySQL Server (8.2)? I've exhausted all options suggested by ChatGPT and kapa.ai. I've been stuck at this isuse for 4 days now as I wasn't aware that this will boil down to Prisma though on the face of it, it seems Prisma but i did not want to jump the gun. As I'm new to Web development, I had to rule out a whole bunch of things and learned debugging along the way (and there were other issues that I got to know along the way, but the error still persists.) By no means, I'm an expert and, hence, could have still missed to know other debugging options. Please help as getting stuck for 4 days is a bit too much. Thanks How to reproduce (optional)Expected behavior (optional)As per the tutorial, it should have asked for the name of Migration as the next step and created a migration file under the folder Prisma in the root directory of my codebase, hence, migrating the empty database to the schema defined in the Information about Prisma Schema, Client Queries and Environment (optional)generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
model User {
id Int @id @default(autoincrement())
email String @db.VarChar(255)
password String @db.VarChar(255)
firstName String @db.VarChar(255) @map("first_name")
}
DATABASE_URL="mysql://root:******@127.0.0.1:3306/DBSampleDB?connect_timeout=300" Don't have any Prisma Client queries for now.
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 23 replies
-
Hi @ruheni @nurul3101 , though my first choice was not to tag and bother anyone from the Prisma team while posting my question here but as it's been around 17 hours and no reply, so thought of tagging. Thank you. |
Beta Was this translation helpful? Give feedback.
-
Not sure if this would help, but you can try using localhost instead of 127.0.0.1, I already had issue with this. |
Beta Was this translation helpful? Give feedback.
-
I am also having this issue |
Beta Was this translation helpful? Give feedback.
-
I have a similar situation and I'm writing about it here. SituationI was creating an app with Docker-compose.yml looking like this
And the DATABASE _URL is this
And same error SolutionDATABASE _URL was like this
|
Beta Was this translation helpful? Give feedback.
-
this helped me make sure your password in the connection string is URL encoded. |
Beta Was this translation helpful? Give feedback.
-
Hey try this command because it worked for me when I faced the same issue today |
Beta Was this translation helpful? Give feedback.
If
migrate dev
does not work locally for you, thendb push
also does not work. Just run it to confirm.This means that the problem is with your local database (or the connection string you are trying to use for it). It is not a general Prisma problem when talking to a MySQL database.