MySQL AI Prompts
42 free, production-ready MySQL AI prompts — copy-paste ready for ChatGPT, Claude, or Cursor. Every prompt ships with fill-in placeholders, a worked example, and production-safety notes, so you get a usable answer on the first try.
- MySQL Intermediate
MySQL InnoDB Buffer Pool Warmup Prompt
Configure buffer-pool dump/restore so a restarted or failed-over MySQL instance serves warm-cache latency immediately instead of a cold-cache stall.
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Intermediate
MySQL caching_sha2_password Auth Migration Prompt
Plan migrating accounts from mysql_native_password to caching_sha2_password without locking out legacy drivers or non-TLS clients.
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Advanced
MySQL Durability & Flush Settings Tuning Prompt
Balance InnoDB durability against throughput by reviewing flush, sync, and doublewrite settings for a given workload and hardware.
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Advanced
MySQL Errant GTID Transaction Reconciliation Prompt
Detect and safely reconcile errant transactions (GTIDs on a replica the source never had) that block failover or break GTID replication.
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Advanced
MySQL Replica Promotion & Failover Runbook Prompt
Produce a step-by-step, safety-checked runbook to promote a replica to primary during planned or emergency failover without split-brain or data loss.
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Intermediate
MySQL Unused & Redundant Index Audit Prompt
Find indexes that are never used or are duplicated/prefix-redundant, and decide which are safe to drop to cut write and storage overhead.
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Advanced
MySQL InnoDB I/O Capacity & Flush Tuning Prompt
Right-size innodb_io_capacity, io_capacity_max, and page-flushing to match real storage IOPS and stop dirty-page or checkpoint stalls.
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Advanced
MySQL Large-Table Archival & Batch Delete Prompt
Design a chunked archive-and-purge for a huge table that avoids long locks, replication lag, and runaway undo/history growth.
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Intermediate
MySQL TLS / Encrypted Connection Hardening Prompt
Enforce encrypted client and replication connections with proper certificates and require_secure_transport without locking out existing apps.
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Advanced
MySQL AUTO_INCREMENT Lock Mode & Bulk Insert Throughput Prompt
Diagnose AUTO_INCREMENT contention and ID gaps, then tune innodb_autoinc_lock_mode for high-throughput inserts.
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Advanced
MySQL Per-Connection Buffer & Memory-Blowup Tuning Prompt
Size per-connection buffers (sort/join/read/tmp) to stop OOM kills and RSS growth under connection load.
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Advanced
MySQL Crash-Safe Replica & Relay Log Recovery Prompt
Recover a replica after a crash or corrupted relay log without breaking consistency or re-cloning.
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Advanced
MySQL Binary Log Disk Growth & Retention Review Prompt
Diagnose runaway binary-log disk usage and design a safe retention, purge, and format strategy without breaking replication or PITR.
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Advanced
MySQL InnoDB Redo Log & Checkpoint Stall Tuning Prompt
Diagnose write stalls and checkpoint bursts caused by an undersized or misconfigured InnoDB redo log, and size redo capacity and flushing for the workload.
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Advanced
MySQL Table & Index Fragmentation Reclaim Prompt
Identify bloated, fragmented InnoDB tables where deletes never returned disk space, and plan a safe, low-lock rebuild to reclaim space and restore performance.
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Advanced
MySQL 5.7 to 8.0 Upgrade Readiness Prompt
Build a safe, staged plan to upgrade MySQL 5.7 to 8.0 (or MariaDB across majors): run the upgrade checker, surface removed/changed defaults, reserved words and collation pitfalls, and sequence the cutover with a rollback path.
- Claude
- ChatGPT
Open prompt - MySQL Advanced
MySQL CPU Spike & Query Load Triage Prompt
Triage a sudden MySQL/MariaDB CPU spike or load surge under live traffic: find the queries and threads burning CPU, separate a bad query plan from a thundering-herd or plan-flip, and stabilize without an outage.
- Claude
- ChatGPT
Open prompt - MySQL Advanced
MySQL Crash Recovery & InnoDB Corruption Triage Prompt
Triage a MySQL/MariaDB instance that won't start or crash-loops after an unclean shutdown or hardware fault: read the error log, decide on innodb_force_recovery levels, and recover data without making corruption worse.
- Claude
- ChatGPT
Open prompt - MySQL Advanced
MySQL Disk Full & Tablespace Reclaim Prompt
Recover a MySQL/MariaDB instance from a full data disk and reclaim space from bloated InnoDB tablespaces, binary logs, undo, and temp files without corrupting data or triggering more downtime.
- Claude
- ChatGPT
Open prompt - MySQL Intermediate
MySQL Foreign Key & Data Integrity Audit Prompt
Audit a MySQL/MariaDB schema for missing or mismatched foreign keys, orphaned rows, ON DELETE/UPDATE behavior risks, and constraint gaps, then propose a safe plan to add integrity without breaking writes or replication.
- Claude
- ChatGPT
Open prompt - MySQL Advanced
MySQL Long-Running Transaction & History List Length Prompt
Track down long-running and idle-in-transaction sessions that bloat the InnoDB history list length, stall purge, and balloon the undo log/ibdata, then resolve them safely without rolling back legitimate work.
- Claude
- ChatGPT
Open prompt - MySQL Intermediate
MySQL Temp Table & Filesort Spill Tuning Prompt
Diagnose queries spilling to on-disk temporary tables and filesorts, tune tmp_table_size/max_heap_table_size and sort/join buffers, and rewrite the offending SQL so sorts and GROUP BYs stay in memory.
- Claude
- ChatGPT
Open prompt - MySQL Intermediate
MySQL Too Many Connections & Pooling Prompt
Diagnose 'ERROR 1040: Too many connections' and connection exhaustion, then right-size max_connections, kill runaway sessions safely, and design application-side pooling so the database stops falling over under load.
- Claude
- ChatGPT
Open prompt - MySQL Intermediate
MySQL User Privilege & Access Hardening Prompt
Audit MySQL/MariaDB users, grants, and host patterns for least privilege: find wildcard hosts, anonymous and password-less accounts, over-broad GRANTs, and risky global privileges, then produce a safe remediation plan.
- Claude
- ChatGPT
Open prompt - MySQL Advanced
Galera & Group Replication Cluster Health Prompt
Diagnose a multi-node MySQL cluster that is out of sync, stalling on flow control, or at risk of split-brain
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Intermediate
MySQL Generated Columns & Functional Indexes Prompt
Index expressions, extracted JSON fields, and computed predicates in MySQL 8.0 using generated columns and functional indexes.
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Intermediate
MySQL JSON Column Schema & Query Design Prompt
Decide where JSON fits in a MySQL 8.0 schema, then design storage, validation, indexing, and queries for it.
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Advanced
MySQL Metadata Lock & Lock-Wait Debug Prompt
Trace which transaction is holding a metadata lock and blocking your DDL or DML before lock_wait_timeout fires.
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Advanced
MySQL Optimizer Hints & Histograms Prompt
Repair a bad MySQL 8.0 query plan using column histograms and optimizer hints instead of fighting the optimizer blind.
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Advanced
MySQL performance_schema & sys Investigation Prompt
Run a structured performance_schema and sys-schema investigation to find what is actually slowing a MySQL 8.0 server.
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Intermediate
ProxySQL Query Routing & Read/Write Split Prompt
Review or design ProxySQL hostgroups, query rules, and read/write splitting for a MySQL backend
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Advanced
MySQL Semi-Synchronous Replication Tuning Prompt
Configure and tune MySQL semi-synchronous replication for the right durability-versus-latency balance without stalling writes.
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL Advanced
MySQL Table Partitioning Strategy Prompt
Design a RANGE, LIST, or HASH partitioning strategy for a large MySQL table with low-cost archival of old data
- Claude
- ChatGPT
- Cursor
Open prompt - MySQL 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 - MySQL 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 - MySQL 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 - MySQL 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 - MySQL 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 - MySQL 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 - MySQL 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 - MySQL 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 - MySQL 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
About these MySQL AI prompts
This is a free, curated collection of MySQL AI prompts for DevOps and platform engineers — prompt templates that turn Claude, ChatGPT, or Cursor into a focused MySQL assistant. Instead of re-explaining your setup every time, each prompt has fill-in placeholders, a realistic worked example, and explicit safety and back-out notes, so it's safe to use against production MySQL.
Browse all 42 above, or explore the wider MySQL prompts and troubleshooting guides, the full DevOps AI prompt library, and run or compare any prompt live in the Prompt Workspace. Hit a production issue instead? Try the free Incident Assistant.