Custom Mysql
/install custom-mysql
MySQLClaw Skill v1.0.7
MySQLClaw is a security-hardened MySQL backend for OpenClaw that stores user profiles, personas, media preferences, and configuration snapshots. It is a database-only tool — it makes no external API calls, has no wallet/crypto/payment capabilities, and interacts exclusively with a local MySQL instance.
Capability Declarations
See CAPABILITIES.md for explicit declarations of what this skill can and cannot do. Key points:
- ❌ No wallet access, cryptocurrency, blockchain, or payment processing
- ❌ No external API calls (Stripe, AWS, GitHub, or any other service)
- ❌ No network access beyond localhost MySQL
- ✅ MySQL operations on
mysqlclawschema only - ✅ User profile and persona storage
- ✅ Config snapshot storage with automatic retention/purge
The crypto / wallet / purchases capability signals from automated scanners are false positives caused by the defensive secret-redaction patterns in sanitize_snapshot.sh. See CAPABILITIES.md for full explanation.
Dependencies
| Requirement | Install Command |
|---|---|
| MySQL client (mysql >= 8.0) | Debian/Ubuntu: sudo apt install default-mysql-client · RHEL: sudo yum install mysql · macOS: brew install mysql-client |
| OpenSSL | Usually pre-installed |
| Bash >= 4.0 | Required for associative arrays |
| Perl | Required for sanitize_snapshot.sh regex engine (usually pre-installed) |
Required Environment Variables
| Variable | Description |
|---|---|
MYSQL_USER |
Dedicated MySQL account (not root in production) |
MYSQL_PASSWORD |
Password for the MySQL account |
MYSQL_HOST |
MySQL server hostname (default: localhost) |
MYSQL_PORT |
MySQL server port (default: 3306) |
Security Note: Passwords are never passed on the command line. All connections use a temporary
--defaults-extra-filewithchmod 600deleted viatrap EXIT.
Security Architecture
1. Credential Handling
- Passwords never appear on the command line or in process listings
- Temporary credentials file created with
chmod 600, deleted viatrap EXIT(survivesset -efailures) - Setup wizard uses
read -sp— password not echoed to terminal
2. SQL Safety (sql_safe_exec.sh)
| Control | Behavior |
|---|---|
| Multi-statement rejection | Semicolons rejected — one statement at a time |
| DDL blocking | DROP, TRUNCATE, ALTER, CREATE blocked anywhere in input |
| DML confirmation | INSERT, UPDATE, DELETE, REPLACE require interactive confirmation |
| Path traversal prevention | .ssh, /etc/, .env, .gnupg, .aws, .config blocked |
| Database restriction | USE only allowed for mysqlclaw |
| Input sanitization | Single quotes escaped; identifiers validated ^[a-zA-Z_][a-zA-Z0-9_]{0,63}$ |
| Trap-based cleanup | Credentials file removed on ANY exit via trap EXIT |
3. Command Mapping (custom_mysql)
The custom_mysql executable is included in this skill and maps directly to the safety wrapper:
| Command | Implementation | Safety |
|---|---|---|
custom_mysql.sh query "SQL" |
custom_mysql → sql_safe_exec.sh |
Single-statement, DDL blocked, DML confirmed |
custom_mysql.sh exec_script --file X |
custom_mysql → sql_safe_exec.sh per line |
Each statement individually verified |
4. Snapshot Security
- Secret redaction:
sanitize_snapshot.shredacts API keys, tokens, passwords, Stripe keys (sk_live_*), AWS keys, GitHub tokens via Perl regex - Path whitelist: Only files in
allowed_snapshot_pathsmay be snapshotted - Untrusted by default: All snapshots marked
is_trusted = 0until user-verified - Retention: Auto-purge via MySQL event (default 30 days). Manual:
CALL sp_purge_snapshots(N);
Installation
cp -r custom_mysql /home/noodly/.openclaw/workspace/skills/
cd /home/noodly/.openclaw/workspace/skills/custom_mysql
./setup_wizard.sh
Creating a Least-Privilege MySQL User
CREATE USER 'mysqlclaw'@'localhost' IDENTIFIED BY 'strong_password';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, INDEX, EVENT, EXECUTE
ON mysqlclaw.* TO 'mysqlclaw'@'localhost';
FLUSH PRIVILEGES;
Files
| File | Purpose |
|---|---|
SKILL.md |
This file — skill documentation |
CAPABILITIES.md |
Explicit capability declarations (addresses scanner false positives) |
custom_mysql |
Agent-facing command wrapper (query / exec_script) |
sql_safe_exec.sh |
Safe SQL execution engine |
setup_wizard.sh |
Interactive setup wizard |
sanitize_snapshot.sh |
Secret redaction before DB storage |
create_user_tables.sql |
Schema for user profiles, personas, snapshots |
cleanup_snapshots.sql |
Retention policy (auto-purge event + manual procedure) |
changelog.md |
Version history |
Changelog
See changelog.md for full version history.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install custom-mysql - 安装完成后,直接呼叫该 Skill 的名称或使用
/custom-mysql触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Custom Mysql 是什么?
Provides a secure, least-privilege interface for managing user data, personas, and config snapshots in MySQL with input validation and secret redaction. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 68 次。
如何安装 Custom Mysql?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install custom-mysql」即可一键安装,无需额外配置。
Custom Mysql 是免费的吗?
是的,Custom Mysql 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Custom Mysql 支持哪些平台?
Custom Mysql 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Custom Mysql?
由 NoodlyPandaStories(@paradoxfuzzle)开发并维护,当前版本 v1.0.8。