Data Destination - MySQL
- 06 Dec 2022
- 2 Minutes to read
- Print
- DarkLight
Data Destination - MySQL
- Updated on 06 Dec 2022
- 2 Minutes to read
- Print
- DarkLight
Article Summary
Share feedback
Thanks for sharing your feedback!
Overview
Help page for setting up a data transfer to MySQL
Supported Protocol
Data Loader: Embulk
- Using the embulk_output_mysql plugin.
Settings
Step 1: General Settings
MySQL Connection Configuration | Yes | - | From the MySQL Connection Configuration created in advance, select the one with the required permissions for this transfer. If you have not previously created any Connection Configurations, click the Add Connection Configuration button to set up a new one. |
Database | Yes | - | Enter the MySQL database name that you wish to transfer to. By pressing the Load Database List button, you can load a list of MySQL database names used to auto-complete the field. |
Table | Yes | - | Enter the table name for the destination. If a table with the name you entered does not exist at the destination, a new one will be created. |
Transfer Mode | Yes | insert | Please refer to the Transfer Modes section below for information regarding each mode. |
Query Before Transfer | No | - | Write an SQL query to execute before the data is transferred to MySQL. Note: If you choose the transfer mode replace, the query cannot be executed. |
Query After Transfer | No | - | Write an SQL query to execute after the data has been transferred to MySQL. |
Transfer Modes
INSERT | APPEND | This transfer mode will append the table at the destination. The transfer data is first loaded into a temporary table generated by trocco, then added to the table at the destination using the insert mode. |
INSERT_DIRECT | APPEND | This transfer mode will append the table at the destination. Directly load data without creating a temporary table. If the transfer happens to fail during execution, there is a chance that incomplete data will be left in the destination. |
TRUNCATE_INSERT | OVERWRITE | This mode will overwrite the data in the table at the destination. The transfer data is first loaded into a temporary table generated by trocco, then added to the table at the destination using the insert mode. Note: before insert, truncate will execute, overwriting the existing table. |
REPLACE | RECREATE | This mode will recreate the table at the destination. At first, the transfer data is loaded into a temporary table generated by trocco. If successful, the target table is dropped and the name of the temporary table is changed to the name of the destination table. The destination table index will be lost. |
MERGE | UPSERT | This transfer mode will update and/or insert into the table. At first the transfer data is loaded into a temporary table generated by trocco. If successful, the query shown below will be run. If a primary key of a record in the intermediate table already exists at the destination table, the destination table record will be updated.If a primary key of a record does not exist, the record will be inserted into the destination table. |
MERGE_DIRECT | UPSERT | This transfer mode will update and/or insert into the table. In this mode, without creating a temporary table, the data will be inserted directly into the destination table. If a primary key of a record in the intermediate table already exists in the destination table, the destination table record will be updated. If a primary key of a record does not exist, the record will be inserted into the destination table. |
Was this article helpful?