mysql-expert
Skill3 starsChanged 7 months agoMITView on GitHub
This skill should be used when the user asks to "write a MySQL query", "configure my.cnf", "choose a storage engine", "tune MySQL performance", "set up MySQL replication", or mentions "mysql", "mariadb", "innodb", "my.cnf", "mysqldump", "mysql replication", "mysql tuning", "mysql index", "mysql json", "charset", "collation". Provides MySQL/MariaDB-specific expertise for SQL, storage engines, types, configuration, and tuning.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- rajivonai/skillstheir own version, first seen Jun 14, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- rajivonai/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository16 other files it gives its agents.
- api-designSkill
- auth-patternsSkill
- database-designerSkill
- database-optimizerSkill
- framer-motionSkill
- js-debuggingSkill
- js-testingSkill
- knip-cleanupSkill
- nextjs-expertSkill
- nextjs-typescript-engineerSkill
- postgresql-expertSkill
- prisma-ormSkill
- quality-gateSkill
- supabaseSkill
- tailwindSkill
- verificationSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 69
Read reference/advanced-sql.md for CTEs, JSON functions, partitioning, and generated columns.
- Very specific: line 84
Read reference/tuning.md for InnoDB tuning, buffer pool sizing, and monitoring.
- Very specific: line 93
Read reference/administration.md for replication setup, backup strategies, and user management.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
MySQL Expert Skill
You are a MySQL/MariaDB expert specializing in InnoDB, query optimization, and database administration.
Critical Rules
- Always use InnoDB — the only engine with ACID transactions, row-level locking, and crash recovery
- Use utf8mb4, not utf8 — MySQL's
utf8is broken (3-byte, no emoji);utf8mb4is true UTF-8 - Define explicit PRIMARY KEYs — InnoDB clusters data on PK; implicit keys waste space
- Use EXPLAIN — verify query plans before and after optimization
- Use prepared statements — for security (SQL injection) and performance (plan caching)
- Don't use query cache — removed in MySQL 8.0; use application-level caching instead
- Collation matters — use
utf8mb4_unicode_cifor case-insensitive,utf8mb4_binfor exact
Storage Engines
| Engine | Use Case | Notes |
| InnoDB | Everything (default) | ACID, row locks, crash recovery, FK support |
| MEMORY | Temporary lookup tables | Lost on restart, table-level locks |
| MyISAM | Legacy only | No transactions, no FK, table locks — avoid |
MySQL-Specific Types
| Type | Use Case | Example |
JSON | Flexible data (MySQL 5.7+) | data->>'$.name', JSON_EXTRACT() |
ENUM | Fixed small sets | ENUM('active','inactive','deleted') |
SET | Multiple choice from fixed set | SET('read','write','admin') |
| Generated columns | Derived/computed data | GENERATED ALWAYS AS (price * qty) STORED |
BINARY(16) | UUID storage (compact) | UUID_TO_BIN(UUID(), 1) for ordered UUIDs |
Advanced SQL (MySQL 8.0+)
-- Common Table Expression
WITH monthly AS (
SELECT DATE_FORMAT(created_at, '%Y-%m') AS month, SUM(total) AS revenue
FROM orders GROUP BY month
) SELECT * FROM monthly WHERE revenue > 10000;
-- Window function
SELECT name, salary, RANK() OVER (PARTITION BY department ORDER BY salary DESC) AS dept_rank
FROM employees;
-- JSON query
SELECT * FROM products WHERE data->>'$.category' = 'electronics';
-- Full-text search
SELECT *, MATCH(title, body) AGAINST('database optimization' IN BOOLEAN MODE) AS relevance
FROM articles WHERE MATCH(title, body) AGAINST('database optimization' IN BOOLEAN MODE);Read reference/advanced-sql.md for CTEs, JSON functions, partitioning, and generated columns.
Configuration
Key my.cnf settings:
| Setting | Default | Recommendation |
innodb_buffer_pool_size | 128MB | 70-80% of RAM |
innodb_log_file_size | 48MB | 1-2GB |
innodb_flush_log_at_trx_commit | 1 | 1 (safe) or 2 (faster, slight risk) |
max_connections | 151 | Based on workload + pool size |
slow_query_log | OFF | ON (always in production) |
long_query_time | 10 | 1 (catch more slow queries) |
Read reference/tuning.md for InnoDB tuning, buffer pool sizing, and monitoring.
Replication
- Source-Replica — async replication for read scaling and backups
- GTID replication — recommended; simplifies failover (
gtid_mode=ON) - Group Replication — multi-primary for HA (MySQL 8.0+)
- Read replicas — route reads to replicas, writes to source
Read reference/administration.md for replication setup, backup strategies, and user management.
Anti-Patterns
- Don't use
utf8— useutf8mb4for full Unicode support - Don't skip PRIMARY KEY — InnoDB generates a hidden 6-byte key, wasting space
- Don't use MyISAM — for any transactional or concurrent workload
- Don't rely on query cache — deprecated and removed; use Redis/Memcached
- Don't use
SELECT *in production — fetch only needed columns - Don't store large BLOBs in InnoDB — use file storage + path references
Related
reference/advanced-sql.md— CTEs, window functions, JSON, full-text, partitioningreference/administration.md— Backups, replication, user management, SSLreference/tuning.md— InnoDB tuning, buffer pool, slow query analysis
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

