Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added requested note

...

  • Basic knowledge of Treasure Data, including the TD Toolbelt.

  • A MySQL instance.

  • Treasure Data must have SELECT, INSERT, DELETE, CREATE, DROP, and ALTER privileges.

Using replace mode may change the schema of the MySQL table. To avoid schema changes to the target table, select the Preserve schema? option.

Configure Results Export to your MySQL Instance

...

After your query setup is complete, select Export Results located at the top right of your query editor.

...

  • Host: The host information of the source database, such as an IP address.

  • User: Username to connect to the source database.

  • Password: Password to connect to the source database.

  • Use SSL: Check this box to connect using SSL

    • Require a valid SSL certificate?: Require that a valid ssl SSL certificate is presented on the connection.

Set Transfer Settings

...

  • Append (default used when no mode option is provided in the URL) Query results are appended to the table. If the table does not exist, a table is created. This mode is atomic.

  • Replace: Replaces the entire content of an existing table with the resulting output of the query. If the table does not exist yet, a new table is created. The replace mode achieves atomicity (so that a consumer of the table always has consistent data) by performing the following three steps in a single transaction:

    1. Create a temporary table.

    2. Write to the temporary table.

    3. Replace the existing table with the temporary table using ALTER TABLE RENAME.

      Using replace mode may change the schema of the MySQL table. To avoid schema changes to the target table, select the Preserve schema? option.

  • Truncate: the system first truncates the existing table, then inserts the query results. If the table does not exist yet, a new table is created. This mode is atomic.

  • Update: a row is inserted unless it can cause a duplicate value in the columns specified in the “unique” parameter: in such case, an update is performed instead. The “unique” parameter is required when using the update mode. This mode is atomic.

...