database-mysql

MySQL/MariaDB database inspection and queries. Use when investigating table schemas, running queries, checking processlist, replication status, InnoDB engine status, or lock contention.

incidentfox/incidentfox34 installsApache-2.0Synced Aug 26

Works with

Claude CodeCursorCodex CLIGitHub CopilotGemini CLI
---
name: database-mysql
description: MySQL/MariaDB database inspection and queries. Use when investigating table schemas, running queries, checking processlist, replication status, InnoDB engine status, or lock contention.
license: Apache-2.0
---

# MySQL Database

## Authentication

**IMPORTANT**: Credentials are injected automatically by a proxy layer. Do NOT check for `MYSQL_PASSWORD` in environment variables - it won't be visible to you. Just run the scripts directly; authentication is handled transparently.

Configuration environment variables you CAN check (non-secret):
- `MYSQL_HOST` - Database host
- `MYSQL_PORT` - Database port (default: 3306)
- `MYSQL_DATABASE` - Database name

---

## MANDATORY: Schema-First Investigation

**Understand the schema before running queries.**

```
LIST TABLES → DESCRIBE TABLE → EXECUTE QUERY → CHECK HEALTH
```

## Available Scripts

All scripts are in `.claude/skills/database-mysql/scripts/`

### list_tables.py - List Tables (START HERE)
```bash
python .claude/skills/database-mysql/scripts/list_tables.py [--database DB]
```

### describe_table.py - Table Schema Details
```bash
python .claude/skills/database-mysql/scripts/describe_table.py --table TABLE_NAME [--database DB]
```

### execute_query.py - Run SQL Queries
```bash
python .claude/skills/database-mysql/scripts/execute_query.py --query "SELECT * FROM users LIMIT 10" [--limit 100]
```

### show_processlist.py - Active Connections
```bash
python .claude/skills/database-mysql/scripts/show_processlist.py [--full]
```

### show_replica_status.py - Replication Health
```bash
python .claude/skills/database-mysql/scripts/show_replica_status.py
```

### show_engine_status.py - InnoDB Engine Status
```bash
python .claude/skills/database-mysql/scripts/show_engine_status.py [--engine innodb]
```

### get_table_locks.py - Lock Contention
```bash
python .claude/skills/database-mysql/scripts/get_table_locks.py
```

---

## Investigation Workflow

### Slow Query Investigation
```
1. show_processlist.py --full (find active/long queries)
2. show_engine_status.py (check InnoDB lock waits, deadlocks)
3. get_table_locks.py (find lock contention)
```

### Replication Lag
```
1. show_replica_status.py (check Seconds_Behind_Master)
2. show_processlist.py (check for blocking queries)
```

More Database skills

supabase-postgres-best-practices

supabase/agent-skills

Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pg_cron, pgmq), vector/semantic search (pgvector), and restoring dumps (pg_restore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.

372.5k

prisma-database-setup

prisma/skills

Guides for configuring Prisma with different database providers (PostgreSQL, MySQL, SQLite, MongoDB, etc.). Use when setting up a new project, changing databases, or troubleshooting connection issues. Triggers on "configure postgres", "connect to mysql", "setup mongodb", "sqlite setup".

241.5k

prisma-postgres

prisma/skills

Prisma Postgres setup and operations guidance across Console, create-db CLI, Management API, and Management API SDK. Use when creating Prisma Postgres databases, working in Prisma Console, provisioning with create-db/create-pg/create-postgres, or integrating programmatic provisioning with service tokens or OAuth.

235.0k

← All Database skills

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY