MySQL#
MySQL is an open-source relational database management system. MySQL has stand-alone clients that allow users to interact directly with a MySQL database using SQL, but more often MySQL is used with other programs to implement applications that need relational database capability.
Credentials
You can find authentication information for this node here.
Basic Operations#
- Execute an SQL query.
- Insert rows in database.
- Update rows in database
Example Usage#
This workflow allows you to create a table and insert data in it on a MySQL database. You can also find the workflow on n8n.io. This example usage workflow would use the following nodes. - Start - Set - MySQL
The final workflow should look like the following image.
1. Start node#
The start node exists by default when you create a new workflow.
2. MySQL node (Execute Query)#
- First of all, you'll have to enter credentials for the MySQL node. You can find out how to do that here.
- Select 'Execute Query' from the Operation dropdown list.
- Enter the following SQL query in the Query field:
CREATE TABLE test (id INT, name VARCHAR(255), PRIMARY KEY (id));
. - Click on Execute Node to run the node.
3. Set node#
- Set the Keep Only Set toggle to true.
- Click on the Add Value button and select 'Number' from the dropdown list.
- Enter
id
in the Name field. - Click on the Add Value button and select 'String' from the dropdown list.
- Enter
name
in the Name field. - Enter the value for the name in the Value field.
- Click on Execute Node to run the node.
4. MySQL1 node (Insert)#
- Select the credentials that you entered in the previous MySQL node.
- Enter
test
in the Table field. - Enter
id, name
in the Columns field. - Click on Execute Node to run the node.