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.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/ivangdavila/mysqlWhat 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:
- Refactor legacy queries to be compatible with
ONLY_FULL_GROUP_BYstrictness. - Design indexing strategies that account for MySQL-specific limitations like prefix requirements for TEXT/BLOB fields.
- Implement robust UPSERT logic using
INSERT ... ON DUPLICATE KEY UPDATEwhile managing auto-increment side effects. - Diagnose and resolve performance bottlenecks caused by collation mismatches in JOIN clauses.
- Write safe transaction blocks that proactively account for InnoDB’s next-key locking and potential deadlock scenarios.
Example Prompts
- "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."
- "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?"
- "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
utf8mb4to prevent emoji-related failures. Avoidutf8as 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 TABLEoperations as they trigger an immediate implicit commit. - Strictness: Keep
ONLY_FULL_GROUP_BYenabled to ensure data integrity, and useANY_VALUE()only when you are certain that the non-aggregated data remains consistent.
Metadata
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 skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-ivangdavila-mysql": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: code-execution
Related Skills
Animations
Create performant web animations with proper accessibility and timing.
Arduino
Develop Arduino projects avoiding common wiring, power, and code pitfalls.
Bulgarian
Write Bulgarian that sounds human. Not formal, not robotic, not AI-generated.
Arabic
Write Arabic that sounds human. Not formal, not robotic, not AI-generated.
Assistant
Manage tasks, communications, and scheduling with proactive and organized support.