This article explains how to import data from MySQL to Treasure Data.
Install Legacy Bulk Import
First, install the Toolbelt, which includes a bulk loader program, on your computer.
After the installation, the
td command is installed on your computer.
Open the terminal and type
td to execute the command.
Make sure you have J
ava as well.
td import:jar_update to download the up-to-date version of our bulk loader:
Importing data from MySQL
Run the following commands to upload data from MySQL.
Because `td import:auto` executes MapReduce jobs to check the invalid rows, it'll take at least 1-2 minutes.
In this example, we assumed that:
the bulk import reads the input data from the
my_sql_tblon the MySQL database specified by the ‘
--db-’ prefixed options
the bulk import session is created automatically by our request using the
When using the
--auto-createoption you must provide the database and table name in the format indicated. The session name will be ‘
Alternatively, you can create the bulk import session with a name of choice, using the
td import:createcommand (for details see Bulk Import Internals, Import Step-by-Step).
the time field is called “date_time” and is provided with the
You can use the following options to specify the access to the MySQL database:
For further details, check the following pages: