MySQL - Query
Execute SQL queries on MySQL and MariaDB databases.
Runs one prepared SQL statement on MySQL with positional ? parameters and returns the rows (or the write result) under result.
Connect your MySQL instance and run parameterized queries with positional ? binding for SQL injection prevention. Compatible with MySQL, MariaDB, and similar databases.
Operations:
- SELECT: Fetch rows from tables with filters, joins, and aggregations.
- INSERT: Add new records to tables.
- UPDATE: Modify existing records matching a condition.
- DELETE: Remove records from tables.
- Stored Procedures: Call stored procedures via CALL statements.
- DDL: Execute CREATE, ALTER, DROP statements for schema management.
How it works
- Resolves the expressions of the node config. Empty
connection_idandsqlfall back to the incoming item. Parameters are read from the undeclaredparamskey, then from the incoming item'sparameters; the declaredparameterskey is not read. - Resolves the connection: a
mysql:///mysql2://URI inconnection_id, aconnection-stringcredential, or abasic-auth/objectcredential withusername,password,host,databaseandport(default 3306). Dates are returned as strings. - Runs
sqlas a prepared statement with the parameters (a single value is wrapped in an array) and closes the connection. - Returns
{ result }onout: the rows for SELECT (an empty array when none) or the driver's result header (affectedRows,insertId…) for writes.
In a workflow
The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.
{
"node_id": "node-find-customer",
"label": "Find customer",
"operator_slug": "integrations.oracle.mysql.query",
"operator_version": "1.0.0",
"config": {
"connection_id": "pi-credential-xxxx",
"sql": "SELECT id, email, created_at FROM customers WHERE email = ?",
"params": [
"{{ $json.email }}"
]
}
}{
"ok": true,
"data": {
"result": [
{
"id": 42,
"email": "ana@example.com",
"created_at": "2026-11-20 15:04:05"
}
]
},
"port": "out"
}Configuration
-
connection_idstring Required -
Credential for your MySQL instance. Accepts credentials of type `connection-string` (mysql:// URI) or `basic-auth` (username + password + host + database).
-
sqlstring Required Accepts expressions -
The SQL statement to execute (e.g., "SELECT * FROM users WHERE id = ?").
-
parametersarray Optional -
Array of values for positional ? parameter binding.
Behaviour in the code
What the implementation does with these keys beyond what the schema says.
-
parameters - Declared in the schema but not read by the worker. Put the values in
paramsinstead. -
paramsRead by the code, not declared - Undeclared key that holds the positional values for
?. A non-array value is sent as a single parameter.
Output ports
out default The statement ran, with or without rows.
{
"result": [
{
"id": 42,
"email": "ana@example.com",
"created_at": "2026-11-20 15:04:05"
}
]
}error Validation, credential resolution, the connection or the statement failed.
{
"error": "Incorrect arguments to mysqld_stmt_execute"
}In expressions
What a later node can read from this node's output with $("MySQL - Query").item.json.<path> (write your node's label instead of MySQL - Query). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through out, from the output shown in Ports.
| Expression | Editor | Worker |
|---|---|---|
$("MySQL - Query").item.json.resultArray of rows returned by the query |
Errors
| Message | Port | Cause and fix |
|---|---|---|
connection_id is required | error | No credential in the config or in the incoming item. |
sql query is required | error | sql is empty. |
Incorrect arguments to mysqld_stmt_execute | error | The number of parameters does not match the ? placeholders. Common cause: the values were set in parameters, which this node ignores; use params. |
Credential <connection_id> has unsupported type '<type>' for integrations.oracle.mysql.query. Use 'connection-string' or 'basic-auth'. | error | The credential type is not supported by this node. |
Input contract
-
connection_idstring Required -
sqlstring Required -
parametersarray Optional
Output contract
-
resultarray<object> Optional -
Array of rows returned by the query
Contracts (JSON Schema)
The definition exactly as the orchestrator declares it. All is the whole *.definition.js; compare it with the sections above to spot differences between the documentation and the schema. Use it to validate a node before you publish.
{
"slug": "integrations.oracle.mysql.query",
"name": "MySQL - Query",
"category": "integrations",
"version": "1.0.0",
"description": "Execute SQL queries on MySQL and MariaDB databases.\n\n Connect your MySQL instance and run parameterized queries with positional ? binding for SQL injection prevention. Compatible with MySQL, MariaDB, and similar databases.\n\n **Operations:**\n - **SELECT:** Fetch rows from tables with filters, joins, and aggregations.\n - **INSERT:** Add new records to tables.\n - **UPDATE:** Modify existing records matching a condition.\n - **DELETE:** Remove records from tables.\n - **Stored Procedures:** Call stored procedures via CALL statements.\n - **DDL:** Execute CREATE, ALTER, DROP statements for schema management.",
"capabilities": [
"sql",
"database",
"mysql",
"mariadb"
],
"group": [
{
"key": "oracle",
"name": "Oracle",
"icon_url": "/icons/integrations/oracle/oracle.svg"
},
{
"key": "mysql",
"name": "MySQL",
"icon_url": "/icons/integrations/oracle/mysql.svg"
}
],
"icon_url": "/icons/integrations/oracle/mysql.svg",
"config_schema": {
"type": "object",
"properties": {
"connection_id": {
"type": "string",
"title": "MySQL Credential",
"description": "Credential for your MySQL instance. Accepts credentials of type `connection-string` (mysql:// URI) or `basic-auth` (username + password + host + database).",
"ui_widget": "connection_picker",
"ui_options": {
"credential_types": [
"connection-string",
"basic-auth"
],
"types": [
"mysql"
]
}
},
"sql": {
"type": "string",
"title": "SQL Query",
"description": "The SQL statement to execute (e.g., \"SELECT * FROM users WHERE id = ?\").",
"format": "expression",
"ui_widget": "sql_editor"
},
"parameters": {
"type": "array",
"title": "Query Parameters",
"description": "Array of values for positional ? parameter binding."
}
},
"required": [
"connection_id",
"sql"
]
},
"input_contract_schema": {
"type": "object",
"properties": {
"connection_id": {
"type": "string"
},
"sql": {
"type": "string"
},
"parameters": {
"type": "array"
}
},
"required": [
"connection_id",
"sql"
]
},
"output_contract_schema": {
"type": "object",
"properties": {
"result": {
"type": "array",
"items": {
"type": "object"
},
"description": "Array of rows returned by the query"
}
}
},
"ports": [
{
"port_id": "out",
"label": "Rows",
"description": "Resulting rows from the query",
"is_default": true,
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"description": "Error occurred during execution",
"is_default": false,
"supports_condition": false
}
],
"execution_mode": "async",
"required_resources": [],
"compatible_worker_pools": [
"standard-io",
"db-io"
],
"tags": [
"sql",
"database"
],
"is_stateful": false,
"publisher": {
"identity": "org_sommatic_ai",
"profile": {
"name": "Sommatic AI",
"verified": true,
"url": "https://sommatic.ai",
"logo_url": null
}
}
}{
"type": "object",
"properties": {
"connection_id": {
"type": "string",
"title": "MySQL Credential",
"description": "Credential for your MySQL instance. Accepts credentials of type `connection-string` (mysql:// URI) or `basic-auth` (username + password + host + database).",
"ui_widget": "connection_picker",
"ui_options": {
"credential_types": [
"connection-string",
"basic-auth"
],
"types": [
"mysql"
]
}
},
"sql": {
"type": "string",
"title": "SQL Query",
"description": "The SQL statement to execute (e.g., \"SELECT * FROM users WHERE id = ?\").",
"format": "expression",
"ui_widget": "sql_editor"
},
"parameters": {
"type": "array",
"title": "Query Parameters",
"description": "Array of values for positional ? parameter binding."
}
},
"required": [
"connection_id",
"sql"
]
}{
"type": "object",
"properties": {
"connection_id": {
"type": "string"
},
"sql": {
"type": "string"
},
"parameters": {
"type": "array"
}
},
"required": [
"connection_id",
"sql"
]
}{
"type": "object",
"properties": {
"result": {
"type": "array",
"items": {
"type": "object"
},
"description": "Array of rows returned by the query"
}
}
}[
{
"port_id": "out",
"label": "Rows",
"description": "Resulting rows from the query",
"is_default": true,
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"description": "Error occurred during execution",
"is_default": false,
"supports_condition": false
}
]Execution
- Execution
async- Stateful
- No
- Credentials
- Resolved on the server from
connection_id; the secret never reaches the workflow. - Capabilities
sqldatabasemysqlmariadb- Tags
sqldatabase
Notes and limits
- There is no
emptyport: a SELECT with no rows leaves throughoutwithresult: []. - A new connection is opened and closed on every run; the node does not retry.
Reviewed against the orchestrator code · 31e874b · 2026-11-26