據 AlphaMoat 統計,截至 2026-10,MYSQL QUERY 累計下載 6,587 次、獲 9 個星標,按累計下載量在本次參與排名的 5,109 個 AI 技能中排名第 2,012 位,在「開發程式設計」分類(560 個)中排名第 212 位。
列表預設按累計下載量排序,也可按星標排序;詳情頁排名按累計下載量計算。
| 平台 | 累計下載 | 星標 | 評論 |
|---|---|---|---|
| ClawHub ↗ | 4661 | 8 | - |
| SkillHub ↗ | 6587 | 9 | — |
各平台的計數口徑不同,統計時間不一致。
自動管理SSH隧道,查詢專案資料庫。適用於在已配置的資料庫上執行SQL查詢,尤其是需要透過SSH訪問的資料庫。
2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。
| 月份 | 累計下載 | 環比 | 星標 |
|---|---|---|---|
| 2026-10 | 6587 | — | 9 |
| 2026-09 | 4822 | — | 9 |
| 2026-08 | 4385 | +2.8% | 9 |
| 2026-07 | 4267 | +6.7% | 9 |
| 2026-06 | 3998 | +4.3% | 8 |
| 2026-05 | 3835 | — | 9 |
以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。
--- name: db-query description: Query project databases with automatic SSH tunnel management. Use when you need to execute SQL queries against configured databases, especially those accessible only via SSH tunnels. Automatically manages SSH connection lifecycle (establishes tunnel before query, closes after). Supports multiple databases distinguished by description/name from config file. --- # Database Query ## 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.
## Configuration
### Setup
1. **Create config file** at `~/.config/clawdbot/db-config.json`:
```bash
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
```
2. **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
3. **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:
```bash
# 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
```json
{
"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):
```bash
export DB_PASSWORD_PRODUCTION_USER_DB="your_db_password"
export SSH_PASSWORD_PRODUCTION_USER_DB="your_ssh_password"
```
## Usage
### List Databases
```bash
python3 /usr/lib/node_modules/clawdbot/skills/db-query/scripts/db_query.py --list
```
### Query a Database
```bash
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:
1. Find database by matching description in config
2. Start SSH tunnel (if configured)
3. Execute query
4. **Automatically close SSH tunnel** (important for cleanup)
### With Custom Config Path
```bash
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
用 gh 命令列工具檢視 GitHub 上的 PR 檢查、工作流執行與 API 查詢的技能。
根據文字描述生成 Mermaid 圖表程式碼。
聚合 16 個搜尋引擎、無需 API Key 的檢索技能。
ProcessOn Diagram Generator 說明從自然語言生成可編輯線上圖表的流程。
用命令列直接列出、配置、授權並呼叫 MCP 服務與工具。
用受管 OAuth 訪問 YouTube Data API,檢索影片並管理頻道內容。
xdrop 透過 Xdrop 伺服器在終端上傳本地檔案或目錄、下載加密分享連結。
透過受管的 OAuth 連線訪問 GitHub REST API。
資料月份:2026-10 · 下載/星標數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。