ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified developer tools Safety 4/5

MySQL

Write correct MySQL queries with proper character sets, indexing, transactions, and production patterns.

Why use this skill?

Master MySQL with OpenClaw. Get expert SQL query generation, production-grade indexing advice, and transaction management patterns tailored for InnoDB.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/ivangdavila/mysql
Or

What This Skill Does

The MySQL skill provides the OpenClaw AI agent with advanced, production-ready capabilities for database management and query generation. It is engineered to move beyond generic SQL generation by enforcing strict MySQL-specific best practices, such as proper character encoding (utf8mb4), InnoDB engine utilization, and deadlock-resilient transaction patterns. This skill acts as a bridge between high-level requirements and the nuanced implementation details required for high-concurrency production environments.

Installation

To integrate this skill into your OpenClaw environment, execute the following command in your terminal: clawhub install openclaw/skills/skills/ivangdavila/mysql

Use Cases

This skill is ideal for developers and database administrators who need to:

  1. Refactor legacy queries to be compatible with ONLY_FULL_GROUP_BY strictness.
  2. Design indexing strategies that account for MySQL-specific limitations like prefix requirements for TEXT/BLOB fields.
  3. Implement robust UPSERT logic using INSERT ... ON DUPLICATE KEY UPDATE while managing auto-increment side effects.
  4. Diagnose and resolve performance bottlenecks caused by collation mismatches in JOIN clauses.
  5. Write safe transaction blocks that proactively account for InnoDB’s next-key locking and potential deadlock scenarios.

Example Prompts

  1. "Analyze this slow query and suggest an indexing strategy. Note that the table uses utf8mb4 and has multiple TEXT columns that I need to filter on."
  2. "I'm migrating from PostgreSQL to MySQL. How should I rewrite my UPSERT logic, and what precautions do I need to take regarding the different transaction isolation levels?"
  3. "Write a MySQL transaction to transfer funds between accounts. Ensure it handles deadlock retries and follows production best practices for row locking."

Tips & Limitations

  • Character Sets: Always enforce utf8mb4 to prevent emoji-related failures. Avoid utf8 as it is fundamentally broken in MySQL.
  • Indexing: Remember that unlike PostgreSQL, MySQL lacks partial indexes. You must use generated columns for complex filtering. Also, ensure you define prefix lengths for indexing large text fields.
  • Transactions: Always assume deadlocks will occur; implement application-level retry logic rather than assuming an error-free execution.
  • DDL Warning: MySQL does not support transactional DDL. Be careful with ALTER TABLE operations as they trigger an immediate implicit commit.
  • Strictness: Keep ONLY_FULL_GROUP_BY enabled to ensure data integrity, and use ANY_VALUE() only when you are certain that the non-aggregated data remains consistent.

Metadata

Stars2102
Views0
Updated2026-03-06
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-ivangdavila-mysql": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#mysql#database#sql#backend#devops
Safety Score: 4/5

Flags: code-execution