MySQL

Use cases and templates: MySQL integration for AI agents

Use MySQL to query rows, insert or modify records, execute raw SQL, and inspect databases, tables, columns, keys, and indexes. Configure the host, port, database, credentials, and SSL mode for the target server.

Query returns rows and a row count. Insert, update, and delete operations accept the data or WHERE clause documented below. Raw SQL can also change schema; use a database account with the permissions the workflow needs.

Use the block

Query, insert, update, delete, and execute raw SQL.

Actions

MySQL Query

Execute SELECT query on MySQL database

Input

ParameterTypeRequiredDescription
hoststringYesMySQL server hostname or IP address
portnumberYesMySQL server port (default: 3306)
databasestringYesDatabase name to connect to (e.g., my_database)
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
querystringYesSQL SELECT query to execute (e.g., SELECT * FROM users WHERE active = 1)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of rows returned from the query
rowCountnumberNumber of rows returned

MySQL Insert

Insert new record into MySQL database

Input

ParameterTypeRequiredDescription
hoststringYesMySQL server hostname or IP address
portnumberYesMySQL server port (default: 3306)
databasestringYesDatabase name to connect to (e.g., my_database)
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
tablestringYesTable name to insert into (e.g., users, orders)
dataobjectYesData to insert as key-value pairs

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of inserted rows
rowCountnumberNumber of rows inserted

MySQL Update

Update existing records in MySQL database

Input

ParameterTypeRequiredDescription
hoststringYesMySQL server hostname or IP address
portnumberYesMySQL server port (default: 3306)
databasestringYesDatabase name to connect to (e.g., my_database)
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
tablestringYesTable name to update (e.g., users, orders)
dataobjectYesData to update as key-value pairs
wherestringYesWHERE clause condition (without WHERE keyword)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of updated rows
rowCountnumberNumber of rows updated

MySQL Delete

Delete records from MySQL database

Input

ParameterTypeRequiredDescription
hoststringYesMySQL server hostname or IP address
portnumberYesMySQL server port (default: 3306)
databasestringYesDatabase name to connect to (e.g., my_database)
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
tablestringYesTable name to delete from (e.g., users, orders)
wherestringYesWHERE clause condition (without WHERE keyword)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of deleted rows
rowCountnumberNumber of rows deleted

MySQL Execute

Execute raw SQL query on MySQL database

Input

ParameterTypeRequiredDescription
hoststringYesMySQL server hostname or IP address
portnumberYesMySQL server port (default: 3306)
databasestringYesDatabase name to connect to (e.g., my_database)
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
querystringYesRaw SQL query to execute (e.g., CREATE TABLE users (id INT PRIMARY KEY, name VARCHAR(255)))

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of rows returned from the query
rowCountnumberNumber of rows affected

MySQL Introspect

Introspect MySQL database schema to retrieve table structures, columns, and relationships

Input

ParameterTypeRequiredDescription
hoststringYesMySQL server hostname or IP address
portnumberYesMySQL server port (default: 3306)
databasestringYesDatabase name to connect to (e.g., my_database)
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)

Output

ParameterTypeDescription
messagestringOperation status message
tablesarrayArray of table schemas with columns, keys, and indexes
databasesarrayList of available databases on the server