Skip to content

MySQL Query

Executes a MySQL SELECT query against a configured MySQL database and returns formatted results. It loads credentials from a provided path, sends the query to the MySQL service, and returns both a human-readable summary and a JSON payload. Designed for read-only queries; use the Execute node for INSERT/UPDATE/DELETE.
Preview

Usage

Use this node when you need to retrieve data from a MySQL database within a workflow. Provide a valid credentials file/path and a SELECT statement. Typical usage is to preview data, feed results into downstream processing, or export results in multiple formats via companion nodes.

Inputs

FieldRequiredTypeDescriptionExample
credentials_pathTrueSTRINGPath or reference to the stored MySQL credentials configuration that matches the 'mysql' credential template./path/to/credentials/mysql.json
timeoutFalseINTMaximum time in seconds to wait for the query to complete before failing.60
sql_textTrueSTRINGA MySQL SELECT statement to execute. Multiline supported. Use only read-only queries here.SELECT id, name, email FROM users ORDER BY created_at DESC LIMIT 10;

Outputs

FieldTypeDescriptionExample
textSTRINGHuman-readable summary of the query results (e.g., row count and formatted rows).MySQL Query Results (10 rows): ...
jsonSTRINGJSON string of the raw query result payload suitable for parsing downstream.{"data": [{"id":1,"name":"Alice"}], "row_count": 1}
htmlSTRINGHTML table representation of the results (may be empty if not generated).......
xlsxBYTESBinary data for an Excel file containing the results (may be empty if not generated).
pdfBYTESBinary data for a PDF rendering of the results (may be empty if not generated).

Important Notes

  • Only SELECT/read-only queries should be executed with this node. For INSERT/UPDATE/DELETE, use the 'MySQL Execute' node.
  • Credentials must conform to the 'mysql' credential template. Ensure host, port, database, username, and password are valid.
  • Queries are subject to timeouts; large or complex queries may need higher timeout settings or additional filtering/limits.
  • Returned formats beyond text/JSON may be empty unless a flow or companion node specifically requests/produces them.
  • Avoid constructing SQL from untrusted input to prevent SQL injection risks.

Troubleshooting

  • Connection/authentication failed: Verify credentials_path points to a valid MySQL configuration with correct host, port, database, username, and password.
  • Query timed out: Increase the timeout input or simplify/add LIMIT to your query.
  • SQL syntax error: Validate your SELECT statement syntax and table/column names in the target database.
  • Empty results: Confirm the query conditions match existing data; test with a simpler query or remove overly restrictive filters.
  • Unexpected output format is empty: This node primarily guarantees text and JSON. If you need HTML/XLSX/PDF, ensure downstream steps or format-specific nodes generate those formats.