Token导航 LogoToken导航TokenDH.com
开发只读clawhub未标认证来源可访问clear审计通过

mysqlMySQL 数据库

Agent Skill

用于辅助数据库表结构、查询语句、迁移脚本和数据维护任务。它适合让 Agent 分析 schema、编写 SQL、排查查询问题、整理索引或生成迁移建议。使用时需要明确数据库类型、连接环境和目标表,区分只读分析与写入变更;涉及删除、更新、迁移和批量导入时,应优先 dry-run、备份或事务保护,避免误操作。

总安装

123,624

周安装

5,050

GitHub Stars

6

下载量

39,996
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:mysql(MySQL 数据库)
来源仓库:https://github.com/ivangdavila/mysql
安装命令:
openclaw skills install mysql
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install mysql

简介

mysql 用于辅助 MySQL 数据库查询编写和索引优化,避免字符集和锁定陷阱。

  • 它能分析慢查询并提供执行计划建议。
  • 使用方式包括输入 SQL 语句或表结构,由 Agent 返回优化方案。
  • 安装命令为 openclaw skills install mysql,需确认连接凭证和只读权限。
  • 涉及更新操作时应优先使用事务或备份恢复点。

SKILL.md

name
MySQL
slug
mysql
version
1.0.1
description
Write correct MySQL queries with proper character sets, indexing, transactions, and production patterns.
metadata
{"clawdbot":{"emoji":"🐬","requires":{"bins":["mysql"]},"os":["linux","darwin","win32"]}}

Quick Reference

TopicFile
Index design deep diveindexes.md
Transactions and lockingtransactions.md
Query optimizationqueries.md
Production configproduction.md

Character Set Traps

  • utf8 is broken—only 3 bytes, can't store emoji; always use utf8mb4
  • utf8mb4_unicode_ci for case-insensitive sorting; utf8mb4_bin for exact byte comparison
  • Collation mismatch in JOINs kills performance—ensure consistent collation across tables
  • Connection charset must match: SET NAMES utf8mb4 or connection string parameter
  • Index on utf8mb4 column larger—may hit index size limits; consider prefix index

Index Differences from PostgreSQL

  • No partial indexes—can't WHERE active = true in index definition
  • No expression indexes until MySQL 8.0.13—must use generated columns before that
  • TEXT/BLOB needs prefix length: INDEX (description(100))—without length, error
  • No INCLUDE for covering—add columns to index itself: INDEX (a, b, c) to cover c
  • Foreign keys auto-indexed only in InnoDB—verify engine before assuming

UPSERT Patterns

  • INSERT ... ON DUPLICATE KEY UPDATE—not standard SQL; needs unique key conflict
  • LAST_INSERT_ID() for auto-increment—no RETURNING clause like PostgreSQL
  • REPLACE INTO deletes then inserts—changes auto-increment ID, triggers DELETE cascade
  • Check affected rows: 1 = inserted, 2 = updated (counter-intuitive)

Locking Traps

  • SELECT ... FOR UPDATE locks rows—but gap locks may lock more than expected
  • InnoDB uses next-key locking—prevents phantom reads but can cause deadlocks
  • Lock wait timeout default 50s—innodb_lock_wait_timeout for adjustment
  • FOR UPDATE SKIP LOCKED exists in MySQL 8+—queue pattern
  • InnoDB default isolation is REPEATABLE READ, not READ COMMITTED like PostgreSQL
  • Deadlocks are expected—code must catch and retry, not just fail

GROUP BY Strictness

  • sql_mode includes ONLY_FULL_GROUP_BY by default in MySQL 5.7+
  • Non-aggregated columns must be in GROUP BY—unlike old MySQL permissive mode
  • ANY_VALUE(column) to silence error when you know values are same
  • Check sql_mode on legacy databases—may behave differently

InnoDB vs MyISAM

  • Always use InnoDB—transactions, row locking, foreign keys, crash recovery
  • MyISAM still default for some system tables—don't use for application data
  • Check engine: SHOW TABLE STATUS—convert with ALTER TABLE ... ENGINE=InnoDB
  • Mixed engines in JOINs work but lose transaction guarantees

Query Quirks

  • LIMIT offset, count different order than PostgreSQL's LIMIT count OFFSET offset
  • != and <> both work; prefer <> for SQL standard
  • No transactional DDL—ALTER TABLE commits immediately, can't rollback
  • Boolean is TINYINT(1)TRUE/FALSE are just 1/0
  • IFNULL(a, b) instead of COALESCE for two args—though COALESCE works

Connection Management

  • wait_timeout kills idle connections—default 8 hours; pooler may not notice
  • max_connections default 151—often too low; each uses memory
  • Connection pools: don't exceed max_connections across all app instances
  • SHOW PROCESSLIST to see active connections—kill long-running with KILL <id>

Replication Awareness

  • Statement-based replication can break with non-deterministic functions—UUID(), NOW()
  • Row-based replication safer but more bandwidth—default in MySQL 8
  • Read replicas have lag—check Seconds_Behind_Master before relying on replica reads
  • Don't write to replica—usually read-only but verify

Performance

  • EXPLAIN ANALYZE only in MySQL 8.0.18+—older versions just EXPLAIN without actual times
  • Query cache removed in MySQL 8—don't rely on it; cache at application level
  • OPTIMIZE TABLE for fragmented tables—locks table; use pt-online-schema-change for big tables
  • innodb_buffer_pool_size—set to 70-80% of RAM for dedicated DB server

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

79.4%
按下载量换算31,757

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

未展示

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills