Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
prisma avatar

Prisma Database Setup Mysql

  • 12 installs
  • 8 repo stars
  • Updated February 9, 2026
  • prisma/cursor-plugin

prisma-database-setup-mysql configures Prisma v7 with MySQL or MariaDB adapters.

About

The prisma-database-setup-mysql skill configures Prisma v7 MySQL datasources with prisma.config.ts env DATABASE_URL, mysql:// connection format, and required @prisma/adapter-mariadb with mariadb driver instantiation including host, port, connectionLimit, user, password, and database fields. PlanetScale setups add relationMode = prisma to emulate foreign keys without database-level constraints. Common issues document connection_limit URL tuning for too many connections and JSON support notes across MySQL 5.7+ and MariaDB 10.2+. Generator uses prisma-client with custom output path per v7 conventions.

  • Configures mysql provider with prisma.config.ts url.
  • Requires PrismaMariaDb adapter in Prisma ORM 7.
  • Documents mysql:// connection string components.
  • Adds relationMode prisma for PlanetScale.
  • Covers connection_limit and JSON version notes.

Prisma Database Setup Mysql by the numbers

  • 12 all-time installs (skills.sh)
  • Ranked #636 of 911 Databases skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
At a glance

prisma-database-setup-mysql capabilities & compatibility

Capabilities
prisma.config.ts datasource configuration · prismamariadb adapter instantiation · planetscale relationmode guidance
Works with
mysql
Use cases
database · api development
From the docs

What prisma-database-setup-mysql says it does

Prisma ORM 7 uses the query compiler by default, so you must use a driver adapter
SKILL.md
npx skills add https://github.com/prisma/cursor-plugin --skill prisma-database-setup-mysql

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs12
repo stars8
Last updatedFebruary 9, 2026
Repositoryprisma/cursor-plugin

How do I set up Prisma with MySQL in version 7?

Configure Prisma ORM 7 with MySQL or MariaDB using driver adapters and PlanetScale options.

Who is it for?

Developers connecting Prisma to MySQL, MariaDB, or PlanetScale.

Skip if: Skip for SQLite-only local prototypes.

When should I use this skill?

User configures Prisma MySQL datasource and driver adapter.

What you get

Schema, config, adapter client, and tuned connection string.

Files

SKILL.mdMarkdownGitHub ↗

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:

   npm install @prisma/adapter-mariadb mariadb

2. Instantiate Prisma Client with the adapter:

   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 })

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.

Related skills

FAQ

What does prisma-database-setup-mysql do?

prisma-database-setup-mysql configures Prisma v7 with MySQL or MariaDB adapters.

When should I use prisma-database-setup-mysql?

User configures Prisma MySQL datasource and driver adapter.

Is this skill safe to install?

Review the Security Audits panel on this page before installing in production.

Databasesdatabases

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.