prisma/cursor-plugin

prisma-database-setup-mysql

MySQL Setup. Reference when using this Prisma feature.

First seen Apr 3, 2026

Installation

$ npx skills add prisma/cursor-plugin --skill prisma-database-setup-mysql

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from prisma/cursor-plugin · top by installs.

npx skills add prisma/cursor-plugin

Browse all from prisma/cursor-plugin

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 9
License MIT
Default branch main
Open issues 0
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

Version7.0.0
LicenseMIT
More metadata
author
prisma
version
7.0.0

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,382 B
  • docs SUMMARY.md 89 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 17 installs

SKILL.md

MySQL Setup

Configure Prisma with MySQL (or MariaDB).

Prerequisites

  • MySQL or MariaDB database
  • Connection string

1. Schema Configuration

In prisma/schema.prisma:

datasource db {
  provider = "mysql"
}

generator client {
  provider = "prisma-client"
  output   = "../generated"
}

2. Config Configuration (v7)

In prisma.config.ts:

import { defineConfig, env } from 'prisma/config'

export default defineConfig({
  schema: 'prisma/schema.prisma',
  datasource: {
    url: env('DATABASE_URL'),
  },
})

3. Environment Variable

In .env:

DATABASE_URL="mysql://user:password@localhost:3306/mydb"

Connection String Format

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.

  1. Install adapter and driver:

``bash npm install @prisma/adapter-mariadb mariadb ``

  1. Instantiate Prisma Client with the adapter:

```typescript 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.MYSQLUSER, password: process.env.MYSQLPASSWORD, database: process.env.MYSQL_DATABASE, })

const prisma = new PrismaClient({ adapter }) ```

PlanetScale Setup

PlanetScale uses MySQL but requires specific settings because it doesn't support foreign key constraints.

In prisma/schema.prisma:

datasource db {
  provider     = "mysql"
  relationMode = "prisma" // Emulate foreign keys in Prisma
}

Common Issues

"Too many connections"

MySQL has a connection limit. Adjust connection pool size in URL:

DATABASE_URL="mysql://...?connection_limit=5"

JSON Support

MySQL 5.7+ supports JSON. MariaDB 10.2+ supports JSON (as an alias for LONGTEXT with check constraints). Prisma handles this, but verify your version.