agentsclimarketplace

Mysql

Skill sanjay3290/ai-skills/skills/mysql

Execute read-only SQL queries against multiple MySQL databases. Use when: (1) querying MySQL databases, (2) exploring database schemas/tables, (3) running SELECT queries for data analysis, (4) checking database contents. Supports multiple database connections with descriptions for intelligent auto-selection. Blocks all write operations (INSERT, UPDATE, DELETE, DROP, etc.) for safety.From its SKILL.md

Install
npx -y skills add sanjay3290/ai-skills --skill mysql

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • reads credentialsReads from 1 credential source: `connections.json`.
  • runs commandsInstructs the agent to run 7 commands, including `pip install -r requirements.txt` and 6 more.

What its file declares

Copied from the file, not written here

The file declares its own license as Apache-2.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

4.0 KB, 870 tokens by cl100k_base, as published. Nobody here has run it

MySQL Read-Only Query Skill

Execute safe, read-only queries against configured MySQL databases.

Requirements

  • Python 3.8+
  • mysql-connector-python: pip install -r requirements.txt

Setup

Create connections.json in the skill directory or ~/.config/claude/mysql-connections.json.

Security: Set file permissions to 600 since it contains credentials:

chmod 600 connections.json
{
  "databases": [
    {
      "name": "production",
      "description": "Main app database - users, orders, transactions",
      "host": "db.example.com",
      "port": 3306,
      "database": "app_prod",
      "user": "readonly_user",
      "password": "your-password",
      "ssl_disabled": false
    }
  ]
}

Config Fields

FieldRequiredDescription
nameYesIdentifier for the database (case-insensitive)
descriptionYesWhat data this database contains (used for auto-selection)
hostYesDatabase hostname
portNoPort number (default: 3306)
databaseYesDatabase name
userYesUsername
passwordYesPassword
ssl_disabledNoSet to true to disable SSL (default: false)
ssl_caNoPath to CA certificate file
ssl_certNoPath to client certificate file
ssl_keyNoPath to client private key file

Usage

List configured databases

python3 scripts/query.py --list

Query a database

python3 scripts/query.py --db production --query "SELECT * FROM users LIMIT 10"

List tables

python3 scripts/query.py --db production --tables

Show schema

python3 scripts/query.py --db production --schema

Limit results

python3 scripts/query.py --db production --query "SELECT * FROM orders" --limit 100

Database Selection

Match user intent to database description:

User asks aboutLook for description containing
users, accountsusers, accounts, customers
orders, salesorders, transactions, sales
analytics, metricsanalytics, metrics, reports
logs, eventslogs, events, audit

If unclear, run --list and ask user which database.

Safety Features

  • Read-only session: Connection uses MySQL SET SESSION TRANSACTION READ ONLY (primary protection)
  • Query validation: Only SELECT, SHOW, DESCRIBE, EXPLAIN, WITH queries allowed
  • Single statement: Multiple statements per query rejected
  • SSL support: Configurable SSL with CA, client cert, and key support
  • Query timeout: 30-second max_execution_time enforced (MySQL 5.7.8+)
  • Memory protection: Max 10,000 rows per query to prevent OOM
  • Column width cap: 100 char max per column for readable output
  • Credential sanitization: Error messages don't leak passwords

Troubleshooting

ErrorSolution
Config not foundCreate connections.json in skill directory
Authentication failedCheck username/password in config
Connection timeoutVerify host/port, check firewall/VPN
SSL errorTry "ssl_disabled": true for local databases
Permission warningRun chmod 600 connections.json
max_execution_time not supportedUpgrade to MySQL 5.7.8+ or MariaDB 10.1.1+

Exit Codes

  • 0: Success
  • 1: Error (config missing, auth failed, invalid query, database error)

Workflow

  1. Run --list to show available databases
  2. Match user intent to database description
  3. Run --tables or --schema to explore structure
  4. Execute query with appropriate LIMIT

What ships with it: 5 files

13.3 KB alongside SKILL.md, 1 of them executable

scripts/

Gives 0 of the 12 instructions most databases sql skills give in 870 tokens

Counted across 609 of the 712 authors here whose files we hold, read 2026-09-06

  • Index all foreign key columnsin 26 of 609
  • Use cursor pagination instead of offsetin 25 of 609, across 20 files
  • Use timestamptz for timestampsin 21 of 609
  • Specify columns instead of using select starin 20 of 609, across 10 files
  • Use parameterized queries for all database interactionsin 20 of 609, across 19 files
  • Use Enum for categorical datain 17 of 609, across 7 files
  • Order by frequently filtered columnsin 17 of 609, across 7 files
  • Batch data insertsin 17 of 609, across 7 files
  • Use expand-contract pattern for schema changesin 17 of 609
  • Use materialized views for real-time aggregationsin 16 of 609, across 6 files
  • Partition tables by timein 16 of 609, across 6 files
  • Use smallest appropriate data typesin 16 of 609, across 6 files

Said here and by no other author read

  • Set file permissions to 600 for connection files
  • List available databases to identify the correct target
  • Match user intent to database descriptions
  • Explore database structure using tables or schema flags
  • Execute queries using the query flag
  • Ask the user if database selection is unclear

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.