AI for MySQL
Optimize and troubleshoot MySQL and MariaDB with AI — query tuning, InnoDB internals, indexing, replication, deadlocks, and zero-downtime migrations.
42 copy-paste prompts · 68 in-depth guides Jump to prompts Jump to guides
Prompts
- 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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
- · 8 min read
MySQL Error Guide: 'You have an error in your SQL syntax' — Fix ERROR 1064
Fix MySQL ERROR 1064 'You have an error in your SQL syntax': reserved words, quoting, version-specific syntax, and hidden characters. Read the near hint.
Read guide - · 8 min read
MySQL Error Guide: 'Table already exists' — Fix ERROR 1050
Fix MySQL ERROR 1050 'Table already exists': rerun migrations, orphaned tablespaces, and case-sensitivity. Make DDL idempotent and reconcile schema state.
Read guide - · 8 min read
MySQL Error: 'ERROR 1044 (42000): Access denied for user to database' — Cause, Fix, and Troubleshooting Guide
Fix MySQL ERROR 1044 (42000) Access denied for user to database: missing GRANTs, wrong host account, and forgotten FLUSH PRIVILEGES.
Read guide - · 8 min read
MySQL Error: 'ERROR 1032 (HY000): Can't find record' — Cause, Fix, and Troubleshooting Guide
Fix MySQL ERROR 1032 (HY000) Can't find record: replica data drift on row-based replication. Diagnose with mysqlbinlog and resync safely.
Read guide - · 8 min read
MySQL Error: 'ERROR 1067 (42000): Invalid default value' — Cause, Fix, and Troubleshooting Guide
Fix MySQL ERROR 1067 (42000) Invalid default value: zero dates under strict sql_mode, DEFAULT on TEXT/BLOB, and CURRENT_TIMESTAMP limits.
Read guide - · 7 min read
MySQL Error: 'ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key' — Cause, Fix, and Troubleshooting Guide
Fix MySQL ERROR 1075 there can be only one auto column and it must be defined as a key: unindexed AUTO_INCREMENT and composite-key ordering.
Read guide - · 7 min read
MySQL Error: 'ERROR 1093 (HY000): You can't specify target table for update in FROM clause' — Cause, Fix, and Troubleshooting Guide
Fix MySQL ERROR 1093 (HY000) You can't specify target table for update in FROM clause: wrap the subquery in a derived table or use a JOIN.
Read guide - · 8 min read
MySQL Error: 'ERROR 1118 (42000): Row size too large' — Cause, Fix, and Troubleshooting Guide
Fix MySQL ERROR 1118 (42000) Row size too large: too many VARCHAR/TEXT columns, wrong row_format, and the 8KB InnoDB page limit.
Read guide - · 8 min read
MySQL Error: 'ERROR 1130 (HY000): Host is not allowed to connect to this MySQL server' — Cause, Fix, and Troubleshooting Guide
Fix MySQL ERROR 1130 (HY000) Host is not allowed to connect: missing host grant, bind-address, and skip_name_resolve gotchas.
Read guide - · 6 min read
MySQL Error: 'ERROR 1136 (21S01): Column count doesn't match value count at row 1' — Cause, Fix, and Troubleshooting Guide
Fix MySQL ERROR 1136 (21S01) Column count doesn't match value count: INSERT column/value mismatch, implicit column lists, and bad CSV loads.
Read guide - · 7 min read
MySQL Error: 'ERROR 1170 (42000): BLOB/TEXT column used in key specification without a key length' — Cause, Fix, and Troubleshooting Guide
Fix MySQL ERROR 1170 (42000) BLOB/TEXT column used in key specification without a key length: add a prefix length or use a generated column.
Read guide - · 7 min read
MySQL Error: 'ERROR 1305 (42000): FUNCTION does not exist' — Cause, Fix, and Troubleshooting Guide
Fix MySQL ERROR 1305 (42000) FUNCTION does not exist: space before parenthesis, missing schema qualifier, and version-specific built-ins.
Read guide - · 8 min read
MySQL Error: 'ERROR 144: Table is marked as crashed and last (automatic?) repair failed' — Cause, Fix, and Troubleshooting Guide
Fix MySQL ERROR 144 Table is marked as crashed and last repair failed: MyISAM corruption where auto-repair gave up. Repair with myisamchk safely.
Read guide - · 7 min read
MySQL Error: 'ERROR 1449 (HY000): The user specified as a definer does not exist' — Cause, Fix, and Troubleshooting Guide
Fix MySQL ERROR 1449 (HY000) The user specified as a definer does not exist: recreate the definer, change DEFINER, or use SQL SECURITY INVOKER.
Read guide - · 7 min read
MySQL Error: 'ERROR 1615 (HY000): Prepared statement needs to be re-prepared' — Cause, Fix, and Troubleshooting Guide
Fix MySQL ERROR 1615 (HY000) Prepared statement needs to be re-prepared: metadata changes, low table_definition_cache, and retry logic.
Read guide - · 7 min read
MySQL Error: 'ERROR 1927 (HY000): Connection was killed' — Cause, Fix, and Troubleshooting Guide
Fix MySQL ERROR 1927 (HY000) Connection was killed: KILL statements, failovers, max_statement_time, and OOM/restart events.
Read guide - · 6 min read
MySQL Error: 'ERROR 2005 (HY000): Unknown MySQL server host' — Cause, Fix, and Troubleshooting Guide
Fix MySQL ERROR 2005 (HY000) Unknown MySQL server host: DNS resolution failures, typos in --host, and stale service/hostnames.
Read guide - · 7 min read
MySQL Error: 'Got error 28 from storage engine' — Cause, Fix, and Troubleshooting Guide
Fix MySQL 'Got error 28 from storage engine': the data disk or tmpdir is full. Free space, relocate tmpdir, and prevent recurrence.
Read guide - · 8 min read
MySQL Error: 'InnoDB: page_cleaner: 1000ms intended loop took ... ms' — Cause, Fix, and Troubleshooting Guide
Fix MySQL 'InnoDB: page_cleaner: 1000ms intended loop took 4013ms': flushing can't keep up. Tune io_capacity, lru_scan_depth, and dirty-page limits.
Read guide - · 8 min read
MySQL Error Guide: 'isn't in GROUP BY' — Fix ERROR 1055 only_full_group_by
Fix MySQL ERROR 1055 only_full_group_by: nonaggregated columns not in GROUP BY. Rewrite with aggregates, ANY_VALUE, or the PK instead of disabling it.
Read guide - · 8 min read
MySQL Error Guide: 'command denied to user' — Fix ERROR 1142
Fix MySQL ERROR 1142 'command denied to user': the account authenticated but lacks the privilege on that object. Grant least-privilege access precisely.
Read guide - · 8 min read
MySQL Error Guide: 'Out of range value for column' — Fix ERROR 1264
Fix MySQL ERROR 1264 'Out of range value for column': integer overflow, unsigned negatives, and decimal limits. Pick a bigger type and validate input.
Read guide - · 8 min read
MySQL Error Guide: 'Incorrect datetime value' — Fix ERROR 1292
Fix MySQL ERROR 1292 'Incorrect datetime value': zero dates, bad formats, and DST gaps. Store valid values and align sql_mode and formats to stop it.
Read guide - · 8 min read
MySQL Error Guide: 'Data too long for column' — Fix ERROR 1406
Fix MySQL ERROR 1406 'Data too long for column': the value exceeds the length or multibyte encoding inflates its bytes. Resize, fix charset, or validate.
Read guide - · 8 min read
MySQL Error Guide: 'Cannot delete or update a parent row' — Fix ERROR 1451
Fix MySQL ERROR 1451 'Cannot delete or update a parent row': a foreign key still references it. Delete children, pick the right ON DELETE, or reparent.
Read guide - · 8 min read
MySQL Error Guide: 'Access denied for user root@localhost' — Fix ERROR 1698
Fix MySQL ERROR 1698 'Access denied for root@localhost': the account uses auth_socket, not a password. Log in as the OS user or switch the plugin safely.
Read guide - · 9 min read
MySQL Error Guide: 'Host is blocked because of many connection errors' — Unblock & Fix
Fix MySQL error 1129 'Host is blocked because of many connection errors': unblock with FLUSH HOSTS, find the misbehaving client, and tune max_connect_errors so it stays fixed.
Read guide - · 9 min read
MySQL Error Guide: 'server is running with the --read-only option' — Fix Read-Only Writes
Fix MySQL error 1290 'running with the --read-only option so it cannot execute this statement': confirm you're on a replica, find stale writes, and clear read_only safely after failover.
Read guide - · 9 min read
MySQL Error Guide: 'Cannot add or update a child row: a foreign key constraint fails' — Fix 1452
Fix MySQL error 1452 'Cannot add or update a child row: a foreign key constraint fails': find the missing parent row, fix insert order, type/charset mismatches, and orphaned data safely.
Read guide - · 9 min read
MySQL Error Guide: 'Specified key was too long; max key length is 767 bytes' — Fix Index Limits
Fix MySQL error 1071 'Specified key was too long': byte vs character limits under utf8mb4, the 767 and 3072 byte caps, prefix indexes, and the innodb_large_prefix setting.
Read guide - · 9 min read
MySQL Error Guide: 'errno 150 Cannot add foreign key constraint' — Fix Mismatched Keys
Fix MySQL error 1215 'Cannot add foreign key constraint': mismatched column types, missing indexes, engine or charset differences, and orphaned data that blocks FK creation.
Read guide - · 9 min read
MySQL Error Guide: 'Lost connection to MySQL server during query' — Fix Dropped Queries
Fix MySQL error 2013 'Lost connection during query': timeouts, oversized packets, OOM kills, network drops, and long-running statements that break mid-execution.
Read guide - · 9 min read
MySQL Error Guide: 'ERROR 1038 (HY001)' Out of Sort Memory, Consider Increasing Server Sort Buffer Size
Fix MySQL ERROR 1038 Out of sort memory: large ORDER BY/GROUP BY sorts, oversized sort_buffer_size, wide row sorts, and missing indexes causing filesort failures.
Read guide - · 9 min read
MySQL Error Guide: 'ERROR 1054 (42S22)' Unknown Column in Field List
Fix MySQL ERROR 1054 Unknown column in field list: typos, missing migrations, wrong alias scope, GROUP BY on aliases, and reserved words causing column resolution failures.
Read guide - · 9 min read
MySQL Error Guide: 'ERROR 1153 (08S01)' Got a Packet Bigger Than max_allowed_packet
Fix MySQL ERROR 1153 Got a packet bigger than max_allowed_packet: oversized BLOBs, large inserts, mysqldump restores, and client/server packet size mismatches.
Read guide - · 9 min read
MySQL Error Guide: 'ERROR 1194 (HY000)' Table Is Marked as Crashed and Should Be Repaired (MyISAM)
Fix MySQL ERROR 1194 Table is marked as crashed: MyISAM corruption from crashes, full disk, or ungraceful shutdown. Repair with REPAIR TABLE and myisamchk safely.
Read guide - · 9 min read
MySQL Error Guide: 'ERROR 1206 (HY000)' The Total Number of Locks Exceeds the Lock Table Size
Fix MySQL ERROR 1206 total number of locks exceeds the lock table size: huge transactions, unindexed bulk DELETE/UPDATE, and undersized buffer pool in InnoDB.
Read guide - · 9 min read
MySQL Error Guide: 'ERROR 1236 (HY000)' Got Fatal Error 1236 From Source When Reading Binlog
Fix MySQL replication ERROR 1236 Got fatal error 1236 from source: purged binlogs, missing GTIDs, corrupt binary logs, and binlog position drift on replicas.
Read guide - · 9 min read
MySQL Error Guide: 'ERROR 1366 (HY000)' Incorrect String Value for Column (utf8 vs utf8mb4)
Fix MySQL ERROR 1366 Incorrect string value: 4-byte emoji into utf8 columns, charset mismatches, and connection encoding issues. Migrate to utf8mb4 safely.
Read guide - · 9 min read
MySQL Error Guide: 'ERROR 2003 (HY000)' Can't Connect to MySQL Server (10061/111)
Fix MySQL ERROR 2003 Can't connect to MySQL server over TCP: server down, wrong port, firewall, bind-address, and skip-networking causing connection refused.
Read guide - · 9 min read
MySQL Error Guide: 'Got an error reading communication packets' Aborted Connections
Fix MySQL Got an error reading communication packets: aborted connections from timeouts, killed clients, max_allowed_packet, and network drops. Diagnose Aborted_clients.
Read guide - · 11 min read
Setting Up MySQL Audit Logging With AI
MySQL audit logging is essential for compliance and forensics. Here's how I use AI to draft JSON filter rules and parse audit logs, then verify everything on a replica.
Read guide - · 9 min read
MySQL Error Guide: 'ERROR 1040 (HY000)' Too Many Connections
Fix MySQL ERROR 1040 Too many connections: diagnose exhausted max_connections, leaked pool connections, sleeping threads, low limits, and per-user caps.
Read guide - · 10 min read
MySQL Error Guide: 'ERROR 1045 (28000)' Access Denied for User
Fix MySQL ERROR 1045 (28000) Access denied for user: diagnose wrong passwords, host-mismatched grants, auth plugin issues, anonymous users, and missing privileges.
Read guide - · 9 min read
MySQL Error Guide: 'ERROR 1062 (23000)' Duplicate Entry for Key
Fix MySQL ERROR 1062 Duplicate entry for key: diagnose unique-key collisions, retries, auto_increment resets, case/collation surprises, and replication conflicts.
Read guide - · 9 min read
MySQL Error Guide: 'ERROR 1114 (HY000)' The Table Is Full
Fix MySQL ERROR 1114 The table is full: diagnose a full disk, exhausted tmp space, MEMORY table limits, capped tablespaces, and per-partition limits in InnoDB.
Read guide - · 8 min read
MySQL Error Guide: 'ERROR 1146 (42S02)' Table Doesn't Exist
Fix MySQL ERROR 1146 Table doesn't exist: diagnose wrong database, case-sensitive names, missing migrations, dropped or orphaned InnoDB tables, and bad grants.
Read guide - · 10 min read
MySQL Error Guide: 'ERROR 1205 (HY000)' Lock Wait Timeout Exceeded
Fix MySQL ERROR 1205 Lock wait timeout exceeded: diagnose long-running transactions, idle transactions holding locks, hot rows, and uncommitted writes in InnoDB.
Read guide - · 10 min read
MySQL Error Guide: 'ERROR 1213 (40001)' Deadlock Found
Fix MySQL ERROR 1213 Deadlock found when trying to get lock: diagnose lock-ordering cycles, gap locks, hot rows, and missing indexes in InnoDB with retry logic.
Read guide - · 9 min read
MySQL Error Guide: 'ERROR 2002 (HY000)' Can't Connect Through Socket
Fix MySQL ERROR 2002 Can't connect to local MySQL server through socket: diagnose a stopped server, wrong socket path, permissions, and crashed mysqld.
Read guide - · 9 min read
MySQL Error Guide: 'ERROR 2006 (HY000)' MySQL Server Has Gone Away
Fix MySQL ERROR 2006 server has gone away: diagnose wait_timeout drops, oversized packets, a crashed or OOM-killed server, and stale pooled connections.
Read guide - · 12 min read
Running a MySQL Group Replication Cluster With AI
Group Replication and Galera fail in confusing ways: quorum loss, flow control, certification conflicts. Here's how I read cluster status and use AI to interpret it safely.
Read guide - · 11 min read
Generated Columns and Functional Indexes in MySQL With AI
A senior DBA walks through MySQL 8.0 generated columns and functional indexes with AI: VIRTUAL vs STORED, indexing JSON and case-insensitive search, EXPLAIN proof.
Read guide - · 11 min read
Fixing MySQL Query Plans With Histograms and Optimizer Hints, With AI
When MySQL's optimizer picks a bad plan, histograms and optimizer hints can rescue you. Here's how I use AI to read EXPLAIN ANALYZE and verify fixes on a replica.
Read guide - · 11 min read
Designing MySQL JSON Columns With AI
A senior DBA's guide to designing MySQL 8.0 JSON columns with AI help: JSON_TABLE, the ->> operator, CHECK validation, generated-column indexing, and pitfalls.
Read guide - · 12 min read
Investigating MySQL Performance With performance_schema and AI
A senior DBA's playbook for MySQL 8.0 performance_schema and sys views with AI: statement analysis, full-table scans, IO by file, wait events, digests, and verification.
Read guide - · 11 min read
Designing ProxySQL Read/Write Splitting With AI
ProxySQL query routing is powerful and easy to get subtly wrong. Here's how I design hostgroups and query rules, then use AI to draft and review the splitting logic safely.
Read guide - · 11 min read
Tuning MySQL Semi-Synchronous Replication With AI
Semi-synchronous replication trades latency for durability. Here's how I use AI to draft the config and tune AFTER_SYNC, timeouts, and failover, then test it on staging.
Read guide - · 11 min read
Partitioning Large MySQL Tables With AI
RANGE partitioning makes huge MySQL tables manageable, but pruning and the PK rules trip people up. Here's how I design the scheme and use AI to verify partition pruning.
Read guide - · 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