mysql

Execute read-only SQL queries against multiple configured MySQL databases.

432|47|Updated Dec 22, 2025
Ready to run
npx skills add https://github.com/sanjay3290/ai-skills --skill mysql-sanjay3290
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: mysql
Source: https://github.com/sanjay3290/ai-skills/tree/main/skills/mysql
Command: npx skills add https://github.com/sanjay3290/ai-skills --skill mysql-sanjay3290

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires mysql-connector-python, and includes scripts (resource) components.

What problem does it solve? Querying production MySQL databases directly risks accidental writes, data leaks, and runaway queries. This Skill provides a safe, read-only query interface with session-level write protection, query validation, and credential management across multiple database connections. ## Core Features & Use Cases - Read-Only Enforcement: Uses MySQL SET SESSION TRANSACTION READ ONLY plus client-side validation that only allows SELECT, SHOW, DESCRIBE, EXPLAIN, and WITH statements, rejecting multi-statement queries and SELECT INTO OUTFILE/DUMPFILE. - Multi-Database Configuration: Define multiple named connections with descriptions in connections.json, enabling intelligent auto-selection based on what data each database contains. - Schema Exploration: Built-in --tables and --schema commands list tables and column definitions from information_schema for quick database discovery. - Safety Limits: 30-second query timeout, 10,000-row memory cap, 100-character column width cap, and password sanitization in error messages. - Use Case: Ask the AI to "show me the 10 most recent orders from the production database" and it will select the right connection, explore the schema if needed, and run a bounded read-only query. ## Quick Start Create a connections.json file with your database credentials, then ask the AI to list the configured MySQL databases and run a SELECT query against one of them.

Frequently Asked Questions about mysql

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run read-only MySQL queries from Python?▼

Use the query.py script with the --db and --query flags after configuring connections.json with your database credentials. The script enforces read-only mode via SET SESSION TRANSACTION READ ONLY and only permits SELECT, SHOW, DESCRIBE, EXPLAIN, and WITH statements.

How do I configure multiple MySQL database connections?▼

Create a connections.json file in the skill directory with a databases array containing name, description, host, port, database, user, and password for each connection. Set file permissions to 600 since it stores credentials, and use --list to see all configured databases.

Can this tool run INSERT, UPDATE, or DELETE statements?▼

No, write operations are blocked at two levels. Client-side validation rejects any query not starting with SELECT, SHOW, DESCRIBE, EXPLAIN, WITH, or DESC, and the MySQL session itself is set to TRANSACTION READ ONLY mode as the primary protection.

Does the MySQL query script support SSL connections?▼

Yes, SSL is enabled by default and supports optional CA certificate, client certificate, and client key paths via the ssl_ca, ssl_cert, and ssl_key config fields. Set ssl_disabled to true for local databases that do not use SSL.

Why does my MySQL query fail with a timeout error?▼

Queries are limited to a 30-second execution window using MySQL's max_execution_time setting, which requires MySQL 5.7.8+ or MariaDB 10.1.1+. Long-running analytical queries will be terminated, so narrow them with WHERE clauses or LIMIT.

What are the limitations of this read-only query approach?▼

Results are capped at 10,000 rows per query and column display width at 100 characters, so large exports require pagination. Multi-statement queries are rejected, and the tool cannot perform any schema modifications or data writes by design.