database-mysql

Inspect MySQL schemas, run read-only queries, and diagnose replication and lock issues.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/erwinv2k-TKG/AgentesVSC --skill database-mysql-erwinv2k-tkg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-mysql
Source: https://github.com/erwinv2k-TKG/AgentesVSC/tree/main/packs/incidentfox/sre-agent/.claude/skills/database-mysql
Command: npx skills add https://github.com/erwinv2k-TKG/AgentesVSC --skill database-mysql-erwinv2k-tkg

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Investigating MySQL or MariaDB issues during an incident requires many manual steps: discovering tables, checking schemas, running safe queries, and diagnosing replication lag or lock contention. This Skill packages those steps into ready-to-run scripts so an agent can inspect a database quickly without risking data modification. ## Core Features & Use Cases - Schema-First Exploration: List tables with size and engine stats, then describe columns, indexes, and foreign keys before writing queries. - Safe Read-Only Queries: Execute SELECT, SHOW, EXPLAIN, and DESCRIBE statements with automatic LIMIT injection; DML/DDL and multi-statement queries are blocked. - Health Diagnostics: Check the processlist for long-running queries, inspect InnoDB engine status for deadlocks, detect lock contention, and assess replication lag with a health classification. - Use Case: During an incident where the application is slow, run the processlist script to find long-running queries, check InnoDB status for deadlocks, and inspect table locks to pinpoint the blocking transaction. ## Quick Start Ask the agent to list the tables in the MySQL database and check for any long-running queries or lock contention.

Frequently Asked Questions about database-mysql

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

FAQPage Schema
How do I run a read-only SQL query against MySQL from a script?

Use the execute_query.py script with a --query argument containing a SELECT, SHOW, EXPLAIN, or DESCRIBE statement. The script validates that only read-only statements run, blocks multi-statement input, and automatically appends a LIMIT clause to SELECT queries missing one.

How do I check MySQL replication lag and slave status?

Run the show_replica_status.py script, which tries SHOW REPLICA STATUS on MySQL 8.0+ and falls back to SHOW SLAVE STATUS on older versions. It reports Seconds_Behind_Master, IO and SQL thread states, and classifies health as healthy, lagging, severely_lagging, or broken.

How do I find MySQL table locks and blocking transactions?

Use the get_table_locks.py script to query performance_schema metadata locks and InnoDB lock waits. It returns current table locks plus waiting and blocking transaction pairs, and sets has_contention to true when lock waits exist.

Does this MySQL skill allow INSERT, UPDATE, or DELETE statements?

No. The execute_query.py script explicitly validates queries and only permits SELECT, SHOW, EXPLAIN, DESCRIBE, and WITH statements. DML and DDL statements are rejected, and semicolons enabling multi-statement injection are blocked for safety.

Why does the MySQL connection fail when MYSQL_PASSWORD is not set?

Credentials are injected transparently by a proxy layer, so MYSQL_PASSWORD is not visible as an environment variable to the scripts. You only need to configure non-secret variables like MYSQL_HOST, MYSQL_PORT, and MYSQL_DATABASE, then run the scripts directly.