# Send MYSQL QUERY to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "db-query",
    "name": "MYSQL QUERY",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/zenixp/db-query",
    "canonicalUrl": "https://clawhub.ai/zenixp/db-query",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/db-query",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=db-query",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "scripts/INSTALL.md",
      "scripts/db_query.py",
      "scripts/config.example.json"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "db-query",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-05T06:04:14.112Z",
      "expiresAt": "2026-05-12T06:04:14.112Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=db-query",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=db-query",
        "contentDisposition": "attachment; filename=\"db-query-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "db-query"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/db-query"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/db-query",
    "downloadUrl": "https://openagent3.xyz/downloads/db-query",
    "agentUrl": "https://openagent3.xyz/skills/db-query/agent",
    "manifestUrl": "https://openagent3.xyz/skills/db-query/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/db-query/agent.md"
  }
}
```
## Documentation

### Overview

Query databases through a centralized configuration file with automatic SSH tunnel management. Handles connection details, SSH tunnel setup/teardown, and query execution.

### Security

Passwords are never exposed in process lists. The skill uses environment variables for credentials:

MYSQL_PWD for database passwords (passed to mysql client)
SSHPASS for SSH tunnel passwords (passed to sshpass)

Recommended: Store credentials in environment variables instead of the config file for better security.

### Setup

Create config file at ~/.config/clawdbot/db-config.json:
mkdir -p ~/.config/clawdbot
# Copy example config and edit
cp /usr/lib/node_modules/clawdbot/skills/db-query/scripts/config.example.json ~/.config/clawdbot/db-config.json



Add database entries with these fields:

name: Description used to find the database (required)
host: Database host (required)
port: Database port (default: 3306)
database: Database name (required)
user: Database user (required)
password: Database password (optional, can use env var)
ssh_tunnel: Optional SSH tunnel configuration



SSH tunnel configuration (if needed):

enabled: true/false
ssh_host: Remote SSH host
ssh_user: SSH username
ssh_port: SSH port (default: 22)
local_port: Local port to forward (e.g., 3307)
remote_host: Remote database host behind SSH (default: localhost)
remote_port: Remote database port (default: 3306)

### Environment Variables (Recommended)

Instead of storing passwords in the config file, use environment variables:

# Format: DB_PASSWORD_<DATABASE_NAME> (spaces replaced with underscores, uppercase)
export DB_PASSWORD_PRODUCTION_USER_DB="your_db_password"

# Format: SSH_PASSWORD_<DATABASE_NAME> for SSH tunnel password
export SSH_PASSWORD_PRODUCTION_USER_DB="your_ssh_password"

### Example Config

{
  "databases": [
    {
      "name": "Production User DB",
      "host": "localhost",
      "port": 3306,
      "database": "user_db",
      "user": "db_user",
      "password": "",
      "ssh_tunnel": {
        "enabled": true,
        "ssh_host": "prod.example.com",
        "ssh_user": "deploy",
        "local_port": 3307
      }
    }
  ]
}

Set environment variables (recommended):

export DB_PASSWORD_PRODUCTION_USER_DB="your_db_password"
export SSH_PASSWORD_PRODUCTION_USER_DB="your_ssh_password"

### List Databases

python3 /usr/lib/node_modules/clawdbot/skills/db-query/scripts/db_query.py --list

### Query a Database

python3 /usr/lib/node_modules/clawdbot/skills/db-query/scripts/db_query.py \\
  --database "Production User DB" \\
  --query "SELECT * FROM users LIMIT 10"

The script will:

Find database by matching description in config
Start SSH tunnel (if configured)
Execute query
Automatically close SSH tunnel (important for cleanup)

### With Custom Config Path

python3 /usr/lib/node_modules/clawdbot/skills/db-query/scripts/db_query.py \\
  --config /path/to/custom-config.json \\
  --database "test" \\
  --query "SHOW TABLES"

### Requirements

MySQL client: apt install mysql-client or equivalent
SSH client: usually pre-installed on Linux/Mac
Python 3.6+

### Notes

SSH tunnels are automatically closed after query execution
Use --list to see all configured databases and their descriptions
Database search is case-insensitive partial match on name field
Local ports for SSH tunnels should be unique per database
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: zenixp
- Version: 1.0.1
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-05T06:04:14.112Z
- Expires at: 2026-05-12T06:04:14.112Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/db-query)
- [Send to Agent page](https://openagent3.xyz/skills/db-query/agent)
- [JSON manifest](https://openagent3.xyz/skills/db-query/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/db-query/agent.md)
- [Download page](https://openagent3.xyz/downloads/db-query)