mysql
Execute SQL queries on MySQL/MariaDB databases to retrieve, modify, or manage data. Supports SELECT, INSERT, UPDATE, DELETE operations with formatted results and connection handling.
Instructions
Execute SQL queries on a MySQL/MariaDB database. Supports SELECT, INSERT, UPDATE, DELETE, SHOW, DESCRIBE, and other SQL statements. SELECT-like queries return formatted table output with column alignment. Non-SELECT queries return affected row count and last insert ID. Connection is closed after each call (no session pooling). Max 1000 rows returned, long values truncated at 200 characters.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | MySQL server hostname or IP address,required | |
| port | No | MySQL port number. Default: 3306 | |
| user | Yes | MySQL username,required | |
| password | No | Password for authentication | |
| database | No | Database name to connect to | |
| query | Yes | SQL query to execute,required | |
| timeout_sec | No | Query timeout in seconds. Default: 30, Max: 120 |