MySQLClaw

# MySQLClaw Skill v1.0.6

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "MySQLClaw" with this command: npx skills add paradoxfuzzle/mysqlclaw

MySQLClaw Skill v1.0.6

The MySQLClaw skill provides a security-hardened interface for managing user data, personas, and configuration snapshots within a MySQL database, specifically designed for OpenClaw agents.


Capability Scope

This skill requires only MySQL database credentials (MYSQL_USER, MYSQL_PASSWORD, MYSQL_HOST, MYSQL_PORT). It does not require, request, or use wallet access, cryptocurrency keys, blockchain-related capabilities, financial transaction systems, or payment processing APIs. The skill's secret-redaction patterns include Stripe key detection purely as a defensive measure to prevent accidental storage of third-party secrets — it does not interact with Stripe or any payment system.


Dependencies

RequirementInstall Command
MySQL client (mysql >= 8.0)Debian/Ubuntu: sudo apt install default-mysql-client · RHEL: sudo yum install mysql · macOS: brew install mysql-client
OpenSSLUsually pre-installed. Verify with openssl version
Bash >= 4.0Required for associative arrays and modern features
PerlRequired for sanitize_snapshot.sh regex engine (usually pre-installed)

Required Environment Variables

VariableDescription
MYSQL_USERDedicated least-privilege MySQL account (see setup below)
MYSQL_PASSWORDPassword for the MySQL account
MYSQL_HOSTMySQL server hostname (default: localhost)
MYSQL_PORTMySQL server port (default: 3306)

Security Note: Passwords are never passed on the command line. All MySQL connections use a temporary --defaults-extra-file with chmod 600 that is deleted via trap EXIT -- even on failure.


Security Architecture

1. Credential Handling

  • Passwords are never exposed on the command line or in process listings.
  • A temporary credentials file (/tmp/.mysqlclaw_XXXXXX.cnf) is created with chmod 600, used for the connection, and deleted via trap EXIT -- guaranteed cleanup even on set -e failure.
  • The setup wizard uses read -sp so the password is not echoed to the terminal.

2. SQL Execution Safety (sql_safe_exec.sh)

All SQL is routed through the sql_safe_exec.sh wrapper which enforces:

ControlBehavior
Multi-statement rejectionInput containing semicolons is rejected outright -- one statement at a time only
DDL blockingDROP, TRUNCATE, ALTER, CREATE are rejected anywhere in the input
DML confirmationINSERT, UPDATE, DELETE, REPLACE trigger interactive confirmation
Path traversal preventionSQL referencing .ssh, /etc/, /home/*/.env, .gnupg, .aws, .config is blocked
Database restrictionUSE statements are only allowed for the mysqlclaw database
Input sanitizationSingle quotes are escaped; identifiers are validated against strict regex
Trap-based cleanupCredentials file is removed on ANY exit via trap EXIT

3. Script Execution (exec_script)

  • custom_mysql exec_script --file path.sql routes all statements through sql_safe_exec.sh.
  • Each statement is executed individually through the single-statement wrapper.
  • Multi-statement lines are rejected; scripts must contain one statement per line.
  • DML statements require interactive confirmation; DDL is blocked.
  • Only bundled/reviewed SQL scripts included in this skill directory should be executed.

4. Snapshot Security

  • Secret redaction: sanitize_snapshot.sh uses Perl-compatible regex to redact API keys, tokens, passwords, private keys, Stripe keys (sk_live_*), and GitHub tokens (ghp_*) before storage.
  • Path whitelist: Only files matching patterns in allowed_snapshot_paths may be snapshotted.
  • Untrusted by default: All snapshots are marked is_trusted = 0 until verified by a user.
  • Retention policy: Snapshots older than 30 days are auto-purged via MySQL event. Manual purge: CALL sp_purge_snapshots(30);

5. Input Validation

  • Database names, usernames, and identifiers are validated against ^[a-zA-Z_][a-zA-Z0-9_]{0,63}$.
  • No eval is used anywhere in the skill.

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_random_password';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, INDEX, EVENT, EXECUTE
    ON mysqlclaw.* TO 'mysqlclaw'@'localhost';
FLUSH PRIVILEGES;

Do not use a root or admin account.


Commands

CommandDescription
./setup_wizard.shInteractive setup wizard
./sql_safe_exec.sh "SQL"Execute a single SQL statement with all safety controls
./sanitize_snapshot.sh <file>Redact secrets from a file
custom_mysql query "SQL"Agent-facing read-only query interface
custom_mysql exec_script --file path.sqlExecute a reviewed SQL script

Changelog

See changelog.md for full version history.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

SQL Data Analyst

Natural language to SQL. Ask questions about your data in plain English, get queries, results, and explanations. Supports SQLite, PostgreSQL, and MySQL. Impo...

Registry SourceRecently Updated
4681Profile unavailable
General

SQL Guard Copilot

Simplify SQL querying and troubleshooting for MySQL, PostgreSQL, and SQLite. Use when users ask to inspect schema, convert natural language to SQL, debug SQL...

Registry SourceRecently Updated
3290Profile unavailable
General

Database Engineering Mastery

Database Engineering Mastery covers schema design, indexing, query optimization, and migration for PostgreSQL, MySQL, SQLite, supporting OLTP/OLAP workloads.

Registry SourceRecently Updated
7621Profile unavailable
General

Supabase Complete Documentation

Complete Supabase platform documentation. Use when working with Supabase - covers authentication (email, OAuth, magic links, phone, SSO), database (PostgreSQL, RLS, migrations), storage (file uploads, CDN), edge functions, realtime subscriptions, AI/embeddings, cron jobs, queues, and platform management. Includes framework integrations (Next.js, React, SvelteKit, etc.).

Registry SourceRecently Updated
7.5K10Profile unavailable