AI for MySQL
Optimize and troubleshoot MySQL and MariaDB with AI — query tuning, InnoDB internals, indexing, replication, deadlocks, and zero-downtime migrations.
Prompts
- Advanced
MySQL Backup & Point-in-Time Recovery Prompt
Design a backup strategy and a point-in-time recovery runbook using xtrabackup/mysqldump plus binlogs.
- Claude
- ChatGPT
- Cursor
Open prompt - Intermediate
MySQL Composite & Covering Index Advisor Prompt
Design the right composite or covering index for a query, with correct column order and a justification for each column.
- Claude
- ChatGPT
- Cursor
Open prompt - Advanced
MySQL InnoDB Buffer Pool & Config Tuning Prompt
Right-size the InnoDB buffer pool and related memory/IO settings for a described workload and host.
- Claude
- ChatGPT
- Cursor
Open prompt - Advanced
MySQL InnoDB Deadlock Analysis Prompt
Decode the LATEST DETECTED DEADLOCK section of SHOW ENGINE INNODB STATUS and prescribe a fix.
- Claude
- ChatGPT
- Cursor
Open prompt - Intermediate
MySQL my.cnf Workload Review Prompt
Review a my.cnf against a described workload and host, flagging risky, missing, and outdated settings.
- Claude
- ChatGPT
- Cursor
Open prompt - Advanced
MySQL Online Schema Change Plan Prompt
Plan a zero-downtime schema change on a large table using gh-ost or pt-online-schema-change.
- Claude
- ChatGPT
- Cursor
Open prompt - Advanced
MySQL Replication Lag & GTID Debug Prompt
Diagnose replica lag and binlog/GTID replication errors and produce a safe recovery plan.
- Claude
- ChatGPT
- Cursor
Open prompt - Intermediate
MySQL Slow Query Log + EXPLAIN Tuning Prompt
Triage a slow MySQL/MariaDB query from the slow query log and produce a step-by-step EXPLAIN-driven tuning plan.
- Claude
- ChatGPT
- Cursor
Open prompt - Advanced
MySQL utf8mb4 Charset Migration Prompt
Plan a safe migration from utf8/latin1 to utf8mb4 across server, databases, tables, columns, and connections.
- Claude
- ChatGPT
- Cursor
Open prompt
Guides
- · 11 min read
AI-Assisted Composite and Covering Index Design for MySQL
Most MySQL performance wins come from one right index, not ten wrong ones. Here's how I use AI to design composite and covering indexes and verify them on a replica.
Read guide - · 11 min read
Debugging Slow MySQL Queries With AI
The slow query log tells you what hurts, but not why. Here's how I pair the slow log with EXPLAIN and an AI reviewer to find the real fix without guessing.
Read guide - · 10 min read
Diagnosing MySQL Deadlocks With AI
Deadlock errors look random until you read the InnoDB status. Here's how I use AI to decode the LATEST DETECTED DEADLOCK block and find the real lock-ordering fix.
Read guide - · 11 min read
Migrating MySQL to utf8mb4 Safely With AI
MySQL's old 'utf8' can't store emoji and silently truncates. Here's how I use AI to plan a safe utf8mb4 migration and verify nothing breaks on a replica first.
Read guide - · 11 min read
MySQL Backup and Point-in-Time Recovery With AI
A backup you've never restored isn't a backup. Here's how I use AI to plan binlog-based point-in-time recovery and rehearse the restore before I need it.
Read guide - · 12 min read
MySQL Replication Setup and Lag Debugging With AI
GTID replication is easy to set up and confusing to debug when it breaks. Here's how I use AI to read replica status, find the lagging step, and recover safely.
Read guide - · 11 min read
Online Schema Changes With gh-ost and AI
A blocking ALTER on a big table is a self-inflicted outage. Here's how I use AI to plan a safe gh-ost migration and verify the cutover before it touches prod.
Read guide - · 11 min read
Tuning InnoDB Buffer Pool and Flushing With AI
InnoDB's buffer pool and flushing settings decide whether your database flies or thrashes. Here's how I use AI to read the metrics and tune them without cargo-culting.
Read guide - · 11 min read
Tuning my.cnf for Your Workload With AI
Copy-pasted my.cnf templates ignore your actual workload. Here's how I use AI to read my status counters and tune the config to what the database is really doing.
Read guide