mysql

mysql is a skill for Claude Code, Codex from chaterm/terminal-skills. It costs 10 tokens per session (928 once invoked), scanned A, original, Apache-2.0.

A guide for managing MySQL and MariaDB databases, which store application data in tables. It covers connections, users and permissions, database operations, backups, restores, and performance checks.

In plain words
What is it for?
Use it to connect locally or remotely, run SQL files or queries, create databases and users, grant access, inspect tables, back up data, restore backups, and monitor running processes.
Why use it?
It provides the commands and procedures needed for routine database administration instead of requiring you to recall them from memory.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to connect locally or remotely, run SQL files or queries, create databases and users, grant access, inspect tables, back up data, restore backups, and monitor running processes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/chaterm/terminal-skills/mysql
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add chaterm/terminal-skills --skill mysql
Clone the repo
git clone --depth 1 https://github.com/chaterm/terminal-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mysql

README.md
[![agentmods](https://agentmods.dev/badge/skills/chaterm/terminal-skills/mysql/github.svg)](https://agentmods.dev/skills/chaterm/terminal-skills/mysql)
Your own site
<a href="https://agentmods.dev/skills/chaterm/terminal-skills/mysql"><img src="https://agentmods.dev/badge/skills/chaterm/terminal-skills/mysql/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mysql

Your own site · 80×15
<a href="https://agentmods.dev/skills/chaterm/terminal-skills/mysql"><img src="https://agentmods.dev/badge/skills/chaterm/terminal-skills/mysql.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 10 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 928 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00010 $0.00928
Opus 5 $0.00005 $0.00464
Sonnet 5 $0.00002 $0.00186
Haiku 4.5 $0.00001 $0.00093

Measured 10d ago against content hash 4db7a6c8f4df, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

mysql scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

database/mysql/SKILL.md · 164 lines

How it starts

The opening of the file, as written. The whole thing — 164 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MySQL 数据库管理

概述

MySQL/MariaDB 数据库的日常管理、备份恢复、性能调优等运维技能。

连接管理

# 本地连接
mysql -u root -p

# 远程连接
mysql -h hostname -P 3306 -u user -p database

# 执行 SQL 文件
mysql -u user -p database < script.sql

# 执行单条命令
mysql -u user -p -e "SHOW DATABASES;"

用户与权限

-- 查看用户
SELECT user, host FROM mysql.user;

-- 创建用户
CREATE USER 'username'@'%' IDENTIFIED BY 'password';

-- 授权
GRANT ALL PRIVILEGES ON database.* TO 'username'@'%';
GRANT SELECT, INSERT ON database.table TO 'username'@'%';

-- 刷新权限
FLUSH PRIVILEGES;

-- 查看权限
SHOW GRANTS FOR 'username'@'%';

数据库操作

-- 数据库管理
SHOW DATABASES;
CREATE DATABASE dbname CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
DROP DATABASE dbname;
USE dbname;

-- 表管理
SHOW TABLES;
DESCRIBE tablename;
SHOW CREATE TABLE tablename;

备份与恢复

mysqldump 备份

# 备份单个数据库
mysqldump -u root -p database > backup.sql

# 备份所有数据库
mysqldump -u root -p --all-databases > all_backup.sql

# 备份表结构
mysqldump -u root -p --no-data database > schema.sql

# 压缩备份
mysqldump -u root -p database | gzip > backup.sql.gz

恢复

# 恢复数据库
mysql -u root -p database < backup.sql

# 从压缩文件恢复
gunzip < backup.sql.gz | mysql -u root -p database

性能监控

-- 查看进程
SHOW PROCESSLIST;
SHOW FULL PROCESSLIST;

-- 查看状态
SHOW STATUS;
SHOW GLOBAL STATUS LIKE 'Threads%';
SHOW GLOBAL STATUS LIKE 'Connections';

-- 查看变量
SHOW VARIABLES LIKE 'max_connections';
SHOW VARIABLES LIKE '%buffer%';

-- 慢查询
SHOW VARIABLES LIKE 'slow_query%';
SHOW GLOBAL STATUS LIKE 'Slow_queries';

常见场景

场景 1:排查慢查询

-- 开启慢查询日志
SET GLOBAL slow_query_log = 'ON';
SET GLOBAL long_query_time = 1;

-- 查看慢查询日志位置
SHOW VARIABLES LIKE 'slow_query_log_file';

-- 分析执行计划
EXPLAIN SELECT * FROM table WHERE condition;
EXPLAIN ANALYZE SELECT * FROM table WHERE condition;

场景 2:锁问题排查

-- 查看锁等待
SHOW ENGINE INNODB STATUS\G

-- 查看当前锁
SELECT * FROM information_schema.INNODB_LOCKS;
SELECT * FROM information_schema.INNODB_LOCK_WAITS;

-- 查看事务
SELECT * FROM information_schema.INNODB_TRX;

Read the full file on GitHub · 164 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 164 lines · 10 tokens per session scan A 4db7a6c8f4df

Subscribe to this mod's changes

mysql is a skill published in the GitHub repository chaterm/terminal-skills (59 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 10 tokens to every session and 928 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

mysql-expert

MySQL and MariaDB administration and development: InnoDB internals, indexing, query tuning, replication, and online schema change. Use when the user mentions MySQL, MariaDB, InnoDB, my.cnf, slow queries, EXPLAIN, binlog or replication lag, gtid, Percona or pt-online-schema-change, or when the task involves designing a…

personamanagmentlayer/pcl · 99 tokens

sql-expert

Expert-level SQL database design, querying, optimization, and administration across PostgreSQL, MySQL, and SQL Server. Use when the user mentions database, PostgreSQL, MySQL, or query optimization, or when the task involves Database Design, Advanced Queries, Indexes and Performance, or Transactions and Concurrency.

personamanagmentlayer/pcl · 66 tokens

Database Schema Reviewer

Reviews database schemas for normalization issues, missing indexes, naming inconsistencies, and scalability risks.

Notysoty/openagentskills · 22 tokens

sql-agent

Write, optimize, and explain SQL queries. Use when user needs to write a query, debug slow SQL, understand a query plan, or design a schema.

chandrudp29/skillhub · 35 tokens

graphjin-eval

Create, extend, run, baseline, and diagnose GraphJin agent evaluations through the graphjin eval CLI.

dosco/graphjin · 27 tokens

graphjin-env

Use when setting up a training or evaluation loop against a GraphJin agent environment — running the container, reading /health, driving episodes hosted or step-by-step or with your own agent over MCP, splitting train from eval, exporting trajectories, and deciding whether two rewards can be compared.

dosco/graphjin · 61 tokens