DOJEUN's Notepad
 LISTへ 

MYSQL - テーブルのデータを export する

テーブルのデータを export する


mysqlにログインしてデータベース指定後以下のように実行

select * into outfile "dump file name" 
         fields terminated by '\t' 
         optionally enclosed by '"' 
         lines terminated by '\n' 
from [table name] where 条件~;

export したデータを importする

load data infile '[export したファイル名]' 
         into table [importするテーブル名] 
         fields terminated by '\t' 
         optionally enclosed by '"' 
         lines terminated by '\n';