MySQL integration

MySQL database: run queries, and find, insert, update and delete rows

Help Centre › Connectors

Overview

MySQL lets a cloud flow read and change rows in your own MySQL or MariaDB database. It runs on Automize's servers, not on a bot, so the database must be reachable from the internet.

  • Regions: Any MySQL or MariaDB server reachable from the internet over TLS: Amazon RDS, Azure, Google Cloud SQL, PlanetScale, or your own.
  • Plans: Cloud flows only. The bot has no MySQL connector yet.

Setting up the connection

Auth type: HTTP Basic.

  1. Make a database user for Automize with only the rights the flows need, e.g. SELECT on the tables they read.
  2. Let the database accept connections from the internet on its port (usually 3306). On AWS, Azure and Google Cloud this is a firewall or security group rule.
  3. In Automize, open Settings → Connectors → MySQL → Add connection.
  4. Enter the server name, the database, the user and its password. Leave Port blank for 3306.
  5. Leave Encryption on Require, or choose Verify the certificate when the server has a certificate from a public authority. MySQL is told the server name for that check, so it looks the name up again to connect.

Rate limits

Each statement stops after 30 seconds. A step brings back at most 5000 rows and says so when it cut the answer.


Data model

Database ─── Schema ─── Table ─── Rows

    Where:  {"status": "open", "customer_id": 42}   every pair must match
            {"status": ["open", "late"]}           any of these
            {"paid_at": null}                      empty (NULL)

Available operations

6 operations available. Click any row to jump to its detail.

OperationCategoryWhat it does
Delete rowsGeneralDelete the rows that match Where. Where cannot be empty, so a step can never empty the whole table by mistake.
Run a statementGeneralRun a statement that changes data (INSERT, UPDATE, DELETE, or a stored procedure) and get how many rows it changed.
Insert rowsGeneralAdd one row, or a list of rows (up to 1000), to a table. The id of the first new row comes back.
Run a queryGeneralRun a SELECT (or any query that returns rows) and get the rows back. Values go in Parameters, never into the SQL text. At most 5000 rows come back.
Find rowsGeneralRead the rows of a table that match Where, without writing SQL.
Update rowsGeneralChange the rows that match Where. Where cannot be empty, so a step can never change the whole table by mistake.

Operations

Delete rows

Delete the rows that match Where. Where cannot be empty, so a step can never empty the whole table by mistake.

ParameterRequiredTypeDescription
Table tableYestextThe table, e.g. invoices. Add the schema in front if it has one ("sales.invoices").
Where whereYesobjectWhich rows: an object of column and value, e.g. {"status": "open", "customer_id": 42}. Every pair must match. A null value matches empty (NULL) cells.

Tips

  • Where cannot be empty, so a step never empties the whole table.

Run a statement

Run a statement that changes data (INSERT, UPDATE, DELETE, or a stored procedure) and get how many rows it changed.

ParameterRequiredTypeDescription
SQL sqlYestextareaThe statement. Put ? where a value goes.
Parameters paramsNolistValues for each ? in the SQL, in order: a list such as ["paid", 100].

Tips

  • Gives back affectedRows: how many rows changed.

Insert rows

Add one row, or a list of rows (up to 1000), to a table. The id of the first new row comes back.

ParameterRequiredTypeDescription
Table tableYestextThe table, e.g. invoices. Add the schema in front if it has one ("sales.invoices").
Row or rows rowsYesobjectOne row as an object of column and value, e.g. {"name": "Ann", "total": 100}, or a list of such objects. Every row needs the same columns.

Tips

  • The id of the first new row comes back as lastInsertId.

Run a query

Run a SELECT (or any query that returns rows) and get the rows back. Values go in Parameters, never into the SQL text. At most 5000 rows come back.

ParameterRequiredTypeDescription
SQL sqlYestextareaThe query. Put ? where a value goes.
Parameters paramsNolistValues for each ? in the SQL, in order: a list such as ["paid", 100].

Tips

  • Put ? in the SQL and the values in Parameters, in order. Never write a value into the SQL.

Find rows

Read the rows of a table that match Where, without writing SQL.

ParameterRequiredTypeDescription
Table tableYestextThe table, e.g. invoices. Add the schema in front if it has one ("sales.invoices").
Where whereNoobjectWhich rows: an object of column and value, e.g. {"status": "open", "customer_id": 42}. Every pair must match. A null value matches empty (NULL) cells. Leave empty for every row.
Columns columnsNotextThe columns to return, separated by commas. Leave empty for all.
Sort by orderByNotextColumn to sort by, with "desc" for largest first, e.g. "created_at desc". Separate several with commas.
Limit limitNonumberMost rows to return. Default 100, at most 5000.

Tips

  • Default limit 100, at most 5000.

Update rows

Change the rows that match Where. Where cannot be empty, so a step can never change the whole table by mistake.

ParameterRequiredTypeDescription
Table tableYestextThe table, e.g. invoices. Add the schema in front if it has one ("sales.invoices").
New values valuesYesobjectAn object of column and new value, e.g. {"status": "paid"}.
Where whereYesobjectWhich rows: an object of column and value, e.g. {"status": "open", "customer_id": 42}. Every pair must match. A null value matches empty (NULL) cells.

Tips

  • Where cannot be empty, so a step never changes the whole table.

FAQ

Is the password safe?
It is stored encrypted and only sent to your server over an encrypted connection. There is no way to connect without encryption.
Can a step change a table it should not?
It can do whatever the database user may do. Give that user only the rights the flows need.

Related connectors

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.