Labsco
prisma logo

prisma-database-setup-mysql

✓ Official8

by prisma · part of prisma/cursor-plugin

MySQL Setup. Reference when using this Prisma feature.

🔥🔥🔥✓ VerifiedFreeAdvanced setup
🧩 One of 7 skills in the prisma/cursor-plugin package — works on its own, and pairs well with its siblings.

MySQL Setup. Reference when using this Prisma feature.

Inspect the full instructions your agent will receiveExpand

This is the exact playbook injected into your agent when the skill activates — shown here so you can audit it before installing. You don't need to read it to use the skill.

by prisma

MySQL Setup. Reference when using this Prisma feature. npx skills add https://github.com/prisma/cursor-plugin --skill prisma-database-setup-mysql Download ZIPGitHub8

3. Environment Variable

In .env:

Copy & paste — that's it
DATABASE_URL="mysql://user:password@localhost:3306/mydb"

Connection String Format

Copy & paste — that's it
mysql://USER:PASSWORD@HOST:PORT/DATABASE
  • USER: Database user

  • PASSWORD: Password

  • HOST: Hostname

  • PORT: Port (default 3306)

  • DATABASE: Database name

Driver Adapter (Prisma ORM 7 required)

Prisma ORM 7 uses the query compiler by default, so you must use a driver adapter.

Install adapter and driver:

Copy & paste — that's it
npm install @prisma/adapter-mariadb mariadb

Instantiate Prisma Client with the adapter:

Copy & paste — that's it
import 'dotenv/config'
import { PrismaClient } from '../generated/client'
import { PrismaMariaDb } from '@prisma/adapter-mariadb'

const adapter = new PrismaMariaDb({
 host: 'localhost',
 port: 3306,
 connectionLimit: 5,
 user: process.env.MYSQL_USER,
 password: process.env.MYSQL_PASSWORD,
 database: process.env.MYSQL_DATABASE,
})

const prisma = new PrismaClient({ adapter })