ssh_db_query
Run read-only queries on remote databases (MySQL, PostgreSQL, MongoDB) via SSH. Executes SELECT SQL or MongoDB find() commands and returns raw output.
Instructions
Runs a read-only query against a remote database. For mysql and postgresql it is strictly limited to SELECT: the query must begin with SELECT and any insert, update, delete, drop, create, alter, truncate, grant, revoke, or exec keyword is rejected before execution. For mongodb it runs a find() and requires the collection parameter. Returns the raw command output as text.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server | Yes | Server name | |
| type | Yes | Database type | |
| database | Yes | Database name | |
| query | Yes | SQL query (SELECT only) or MongoDB find query | |
| collection | No | Collection name (MongoDB only) | |
| dbUser | No | Database user | |
| dbPassword | No | Database password | |
| dbHost | No | Database host (default: localhost) | |
| dbPort | No | Database port |