{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Legacy Bulk Import From Mysql","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"legacy-bulk-import-from-mysql","__idx":0},"children":["Legacy Bulk Import From Mysql"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["この記事では、MySQLからTreasure Dataにデータをインポートする方法について説明します。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"legacy-bulk-importのインストール","__idx":1},"children":["Legacy Bulk Importのインストール"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["まず、バルクローダープログラムを含む",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://toolbelt.treasuredata.com/"},"children":["Toolbelt"]},"をお使いのコンピューターにインストールします。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ダウンロード","__idx":2},"children":["ダウンロード"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://toolbelt.treasuredata.com/win"},"children":["Toolbelt Installer for Windows"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://toolbelt.treasuredata.com/mac"},"children":["Toolbelt Installer for Mac OS X"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/tools/cli-and-sdks/quickstart"},"children":["Toolbelt Installer for Linux"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["インストール後、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td"]},"コマンドがコンピューターにインストールされます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ターミナルを開き、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td"]},"と入力してコマンドを実行します。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Java"]},"もインストールされていることを確認してください。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td import:jar_update"]},"を実行して、最新バージョンのバルクローダーをダウンロードします。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$ td\nusage: td [options] COMMAND [args]\n$ java\nUsage: java [-options] class [args...]\n$ td import:jar_update\nInstalled td-import.jar 0.x.xx into /path/to/.td/java\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"mysqlからのデータインポート","__idx":3},"children":["MySQLからのデータインポート"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下のコマンドを実行して、MySQLからデータをアップロードします。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$ td db:create my_db\n$ td table:create my_db my_tbl\n$ td import:auto \\\n  --auto-create my_db.my_tbl \\\n  --format mysql \\\n  --db-url jdbc:mysql://my_sql_host/my_sql_db \\\n  --db-user my_user \\\n  --db-password my_pass \\\n  --time-column date_time \\\n  my_sql_tbl\n"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td import:auto"]},"は無効な行をチェックするためにMapReduceジョブを実行するため、少なくとも",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["1〜2分"]},"かかります。"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["この例では、以下を前提としています。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["バルクインポートは、'",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--db-"]},"'プレフィックスが付いたオプションで指定されたMySQLデータベース上の",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["my_sql_tbl"]},"から入力データを読み取ります"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["バルクインポートセッションは、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--auto-create"]},"オプションを使用して自動的に作成されます。"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--auto-create"]},"オプションを使用する場合、指定された形式でデータベースとテーブル名を提供する必要があります。セッション名は'",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["my_db.my_tbl"]},"'になります。"," ","または、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td import:create"]},"コマンドを使用して、任意の名前でバルクインポートセッションを作成することもできます（詳細は",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/int/legacy-bulk-import-internals"},"children":["Bulk Import Internals, Import Step-by-Step"]},"を参照）。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["時刻フィールドは\"date_time\"と呼ばれ、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--time-column"]},"オプションで指定されます"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["MySQLデータベースへのアクセスを指定するには、以下のオプションを使用できます。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"MySQL固有のオプション:\n--db-url URL                     JDBC接続URL\n--db-user NAME                   MySQLアカウントのユーザー名\n--db-password PASSWORD           MySQLアカウントのパスワード\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["詳細については、以下のページをご確認ください。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/int/legacy-bulk-import-internals"},"children":["Bulk Import Internals"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/int/legacy-bulk-import-tips-and-tricks"},"children":["Bulk Import Tips and Tricks"]}]}]}]},"headings":[{"value":"Legacy Bulk Import From Mysql","id":"legacy-bulk-import-from-mysql","depth":1},{"value":"Legacy Bulk Importのインストール","id":"legacy-bulk-importのインストール","depth":1},{"value":"ダウンロード","id":"ダウンロード","depth":2},{"value":"MySQLからのデータインポート","id":"mysqlからのデータインポート","depth":2}],"frontmatter":{"seo":{"title":"Legacy Bulk Import From Mysql"}},"lastModified":"2026-03-10T06:17:28.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/int/legacy-bulk-import-from-mysql","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}