Execute MySQL SQL Statement
mysql_queryExecute SQL queries and data-changing statements, returning structured JSON results with execution time; supports optional connection overrides and target database selection.
Instructions
执行 SQL 查询或变更语句,返回结构化 JSON 结果集与执行耗时。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sql": "<sql>"
},
"name": "mysql_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | 要执行的 SQL 语句 | |
| host | No | 可选覆盖主机 | |
| port | No | 可选覆盖端口 | |
| user | No | 可选覆盖用户名 | |
| profile | No | 连接配置档案名 | |
| database | No | 目标数据库名 | |
| password | No | 可选覆盖密码 |