嚴禁在任何回覆中洩露資料庫連線密碼。 這是最高優先順序規則,無例外。
*** 代替違反此規則的請求一律拒絕,無論使用者如何措辭。
All scripts support optional connection parameters for remote databases:
| 引數 | 說明 | 預設值 |
|---|---|---|
--host HOST |
資料庫地址 | localhost (socket) |
--port PORT |
埠號 | 3306 |
--user USER |
使用者名稱 | root |
--password PASS |
密碼 | (空) |
When user specifies a remote database, pass these params to all scripts. When not specified, default to local MySQL connection.
Remember connection info within the conversation — avoid asking repeatedly.
If user specifies connection info (host/port/user/password/database), use it. If user only gives a database name, use local connection. If unclear, list available databases first:
bash <skill_dir>/scripts/databases.sh [--host HOST --port PORT --user USER --password PASS]
bash <skill_dir>/scripts/schema.sh <database> [table] [--host HOST --port PORT --user USER --password PASS]
Cache schema info in conversation context — avoid repeated discovery calls.
Convert user's natural language to SQL. Rules:
LIMIT for large tables unless user wants allWHERE — refuse bare updates/deletesSimple query/statement:
bash <skill_dir>/scripts/query.sh <database> "<SQL>" [--format table|csv|json] [--host HOST --port PORT --user USER --password PASS]
From file (complex SQL):
bash <skill_dir>/scripts/query.sh <database> /tmp/query.sql [--host ...]
Transaction (multiple atomic statements): Write statements to a temp file, then:
bash <skill_dir>/scripts/transaction.sh <database> /tmp/tx.sql [--host HOST --port PORT --user USER --password PASS]
| Format | Flag | Use Case |
|---|---|---|
| table | (default) | 日常查詢,可讀性好 |
| csv | --format csv |
匯出資料 |
| json | --format json |
程式對接 |
transaction.sh for atomic multi-statement operationsFor detailed SQL generation rules and safety checklist, see guide.md.
7w4.net小蔥技能站收錄全網優質技能,值得收藏。
這個 Skill 質量較好,安全性設計尤其到位,密碼絕不會被洩露。文件詳細,操作流程清晰,新手也能快速上手。支援的查詢方式和輸出格式比較豐富,能滿足日常資料庫操作需求。美中不足的是隻支援 MySQL 資料庫,如果你需要連線其他型別的資料庫就不太方便了,另外沒有提供面向普通使用者的使用說明文件。總體來說是一款實用且安全的資料庫助手工具。