MySQLExtend icon

MySQLExtend

Upsert, get, add and update data in MySQL

Overview

The MySQLExtend node for n8n allows you to update rows in a MySQL database table. Specifically, when using the Update operation, this node updates existing records based on a specified key (such as an id) and a set of columns provided by the user. This is useful in scenarios where you need to modify data in bulk or automate updates to your database from workflows.

Practical examples:

  • Updating product information in an inventory system.
  • Modifying user details in a customer database.
  • Bulk updating status fields after processing data in n8n.

Properties

Name Type Meaning
Table String Name of the table in which to update data.
Update Key String Name of the property used to identify which rows should be updated (e.g., "id").
Columns String Comma-separated list of properties/columns to update in each row (e.g., "name,description").

Output

The output is a JSON array where each item represents the result of an update query for an input item. The structure typically includes metadata about the update operation, such as the number of affected rows. Example output for each item:

[
  {
    "fieldCount": 0,
    "affectedRows": 1,
    "insertId": 0,
    "info": "Rows matched: 1  Changed: 1  Warnings: 0",
    "serverStatus": 2,
    "warningStatus": 0
  }
]
  • If an error occurs and "Continue On Fail" is enabled, the output will include an object with an error field containing the error message.

Dependencies

  • MySQL Database: Requires access to a MySQL server.
  • Credentials: You must configure MySQL credentials in n8n under the name mySqlExtend.
  • Environment Variables: If SSL is required, you may need to provide certificates via credential fields.

Troubleshooting

Common Issues:

  • Invalid Table or Column Names: Ensure that the table and column names match those in your database schema.
  • Missing Update Key: The update key must exist in both the input data and the target table.
  • Database Connection Errors: Check credentials, host, port, and network connectivity.

Error Messages:

  • "The operation \"update\" is not supported!": This should not occur if you select the correct operation, but indicates a misconfiguration.
  • SQL errors (e.g., syntax errors, constraint violations) will appear in the error field if "Continue On Fail" is enabled.

How to resolve:

  • Double-check all property values.
  • Verify database permissions for the user.
  • Review the error message for specific guidance.

Links and References

Discussion