Pipory
Node reference

MySQL

MySQL node reference - all 23 operations, the credential it needs, and a worked example.

Read and write a MySQL database without writing SQL: select, insert, update, upsert, replace and delete rows, bulk writes, transactions, stored procedures, and schema discovery. Raw SQL is still there when you want it.

Credential: MySQL connection string - see Credentials.

Privileges

Each operation below lists the privilege it needs. Privileges are GRANTed to the MySQL account in the connection string. MySQL has no scopes and no consent screen - the equivalent question is which privilege the connecting account holds on the object, which is exactly what a command denied to user ... error is asking for. Narrow the blast radius by connecting as an account granted only what the workflow needs. If a run fails with a permission error, the node names the missing privilege in the error - grant it and re-run; you do not need to rebuild the workflow.

Operations (23)

Rows — read

OperationWhat it doesPrivilege
selectRowsSelect rowsSELECT on the table
getRowGet one rowSELECT on the table
countRowsCount rowsSELECT on the table

Rows — write

OperationWhat it doesPrivilege
insertRowInsert a rowINSERT on the table
insertRowsInsert many rowsINSERT on the table
updateRowsUpdate rowsUPDATE on the table (and SELECT for the filter)
upsertRowInsert or update a rowINSERT and UPDATE on the table
upsertRowsInsert or update many rowsINSERT and UPDATE on the table
replaceRowReplace a rowINSERT and DELETE on the table
replaceRowsReplace many rowsINSERT and DELETE on the table
deleteRowsDelete rowsDELETE on the table (and SELECT for the filter)
truncateTableEmpty a table (truncate)DROP on the table (TRUNCATE is DDL in MySQL)

SQL

OperationWhat it doesPrivilege
executeQueryRun a SQL queryWhatever the statement itself needs
executeTransactionRun statements in a transactionWhatever the statements themselves need
explainQueryExplain a query planSELECT on everything the plan touches

Procedures & functions

OperationWhat it doesPrivilege
callProcedureCall a stored procedureEXECUTE on the procedure
callFunctionCall a functionEXECUTE on the function

Schema

OperationWhat it doesPrivilege
listDatabasesList databasesConnect — information_schema shows only what you can see
listTablesList tablesConnect — information_schema shows only what you can see
listColumnsList columnsConnect — information_schema shows only what you can see
listIndexesList indexesConnect — information_schema shows only what you can see
listConstraintsList keys and constraintsConnect — information_schema shows only what you can see
getServerInfoGet server infoConnect

Example

Learn the id of the row you just inserted

MySQL has no RETURNING clause, so the only way to find out the primary key of a row you just created is insertId — and until SW20.2 this node discarded it. Every write reported rows: [] and rowCount: 0 because mysql2 resolves a write to a ResultSetHeader object rather than an array, and the node kept Array.isArray(rows) ? rows : [].

Set Operation to insertRow, then fill in:

FieldValueNotes
tablesignupsIdentifiers are escape-quoted, never interpolated into the statement
values{"email": "{{ myTrigger.email }}", "source": "{{ myTrigger.utmSource }}"}Bound parameters — an expression here is a value, never SQL

Sets {{signup.insertId}} (the AUTO_INCREMENT key — the whole point of this operation on MySQL), {{signup.rowCount}} (affected rows) and {{signup.rows}}.