Skip to content

MySQL Query

Executes a MySQL SELECT query using configured database credentials and returns the results. The node sends the provided SQL to the MySQL service endpoint and formats the response into a readable text summary and a JSON payload.
Preview

Usage

Use this node when you need to read data from a MySQL database as part of a workflow. Provide the credentials path, adjust the timeout if needed, and enter a valid MySQL SELECT statement. The resulting text and JSON can feed into downstream data processing, filtering, or visualization nodes. For write operations (INSERT/UPDATE/DELETE), use the dedicated execute node instead.

Inputs

FieldRequiredTypeDescriptionExample
credentials_pathTrueNot specifiedPath or reference to the MySQL credentials to authenticate the request. Must correspond to the MySQL credential template.
timeoutTrueNot specifiedMaximum time to wait for the query to complete before timing out.30
sql_textTrueSTRINGA valid MySQL SELECT query to execute against the target database.SELECT * FROM users LIMIT 10

Outputs

FieldTypeDescriptionExample
textSTRINGA human-readable summary of the MySQL query results.MySQL Query Results: 10 rows returned
jsonJSONThe raw result data from the query in JSON format.{"rows": [{"id": 1, "name": "John"}], "row_count": 10}

Important Notes

  • SELECT only: This node is intended for read-only SELECT queries. For INSERT/UPDATE/DELETE operations, use SaltMySQLExecute.
  • Credentials required: Ensure the provided credentials path references a valid MySQL credential configuration.
  • Query validity: The SQL must be valid MySQL syntax and the referenced tables/columns must exist.
  • Timeouts: Long-running queries may time out; adjust the timeout input or optimize the query.
  • Result size: Very large result sets can impact performance and may exceed limits; consider adding LIMIT/filters.

Troubleshooting

  • Authentication failed: Verify the credentials_path points to a valid MySQL credential and that the database is reachable.
  • SQL syntax error: Check the sql_text for MySQL syntax issues and correct table/column names.
  • Timeouts or network errors: Increase the timeout value, ensure network connectivity to the database, and confirm the database is responsive.
  • Empty results: Confirm the WHERE clause and filters are correct, and that data exists in the target tables.