|
LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name'
[REPLACE | IGNORE]
[CHARACTER SET charset_name]
[{FIELDS | COLUMNS}
[TERMINATED BY 'string']
[[OPTIONALLY] ENCLOSED BY 'char']
[ESCAPED BY 'char']
]
[LINES
[STARTING BY 'string']
[TERMINATED BY 'string'
]
[IGNORE number LINES]
[(col_name_or_user_var,...)]
[SET col_name = expr,...]
注:关键字 FIELDS 和 LINES 要出现才能指定后面的参数
例子:
LOAD DATA infile '/data/app/default/phpmyadmin/importPath/CsvFormatFile.sql' INTO TABLE test_table CHARACTER SET 'utf8' FIELDS TERMINATED BY '@' ENCLOSED BY '`' LINES TERMINATED BY '#####'; |
|