Skip to main content

MySQL Component

Query and manage data in a MySQL Database

Component key: mysql

Description

MySQL is a popular relational database system. This component allows you to query a MySQL database.

Instead of generating dynamic queries and sanitizing SQL yourself, you can use generic queries with parameter placeholders using the ? placeholder. You can use the placeholder several times in your query, and provide a list of optional parameters to the action. For example, you can enter a query that reads INSERT INTO users (name, email) VALUES (?, ?). Then, configure the optional parameters input to look like the following, ["myUsername", "myEmail"] or whatever values you like. Values provided for name and email are sanitized automatically.

If you are dynamically generating SQL queries and do not know how many parameters you will have ahead of time, create a dynamic array of parameters in another step and reference them through the Reference Parameters input.

Connections

MySQL Connection

Create a new MySQL connection and enter the host, port, and database for your MySQL server. The username and password are optional inputs that can be put directly into a MySQL connection.

Actions

Query

Returns the results of a MySQL database query | key: query

Output Example Payload

{
"data": [
{
"id": 1,
"mycolumn1": "foo",
"mycolumn2": "bar"
},
{
"id": 2,
"mycolumn1": "foo2",
"mycolumn2": "bar2"
}
]
}