Install
openclaw skills install mysql-query-assistanttranslate natural-language analytics requests into mysql queries, connect to a live mysql database, inspect schema and column comments, execute read-only sql, and validate query correctness against real results. use when chatgpt needs to work with mysql through direct connection details provided by environment variables, especially for ad hoc analysis, sql generation, schema discovery, query debugging, or cautious database workflows that must verify results before presenting them. also use for restricted write workflows that first generate a preview select and never auto-execute the write statement.
openclaw skills install mysql-query-assistantUse this skill to turn a user's request into safe MySQL work against a live database.
For every request, follow this sequence:
references/connection-and-safety.md.scripts/run_read_query.py.SELECT queries only.INSERT, UPDATE, DELETE, REPLACE, ALTER, DROP, TRUNCATE, CREATE, GRANT, or REVOKE.SELECT * unless schema exploration is the user's goal.LIMIT when the user did not ask for a full extract.Before generating SQL, inspect schema with scripts/introspect_schema.py.
Use this order:
If comments are missing, fall back to table names, column names, keys, and a few small probing queries.
Use scripts/run_read_query.py to execute the SQL.
The script rejects non-read-only statements. It also blocks multi-statement execution.
When verifying a query:
When the user asks for a write operation:
SELECT that shows exactly which rows would be affected.WHERE clause.Use this structure unless the user asks for a different format.
[final sql]
Show 5 to 20 rows when available and useful. Keep wide tables compact.
Provide a brief natural-language summary of what the query shows.
Include assumptions, caveats, and any schema uncertainties.
references/connection-and-safety.md.scripts/introspect_schema.py for schema discovery.scripts/run_read_query.py for executing read-only SQL.User request: 统计最近 7 天每天新增用户数
Expected approach:
User request: 把 status = 'pending' 且 30 天前创建的订单改成 expired
Expected approach:
SELECT for the target rows.UPDATE SQL separately.UPDATE.