mysqlimport ให้ CLI สำหรับ LOAD DATA SQL Statement Options ตอบโจทย์ Clauses ของ LOAD DATA โดยตรง
การเรียกใช้
shell> mysqlimport [options] db_name textfile1 [textfile2 ...]
การกำหนดชื่อตาราง
Strip Extension ออกจากชื่อไฟล์ -> ใช้เป็นชื่อตาราง
sample.txt,sample.text,sample-> ตารางsample
ตัวเลือกสำคัญ
| ตัวเลือก | คำอธิบาย |
|---|---|
--bind-address=ip_address | เลือก Network Interface |
--character-sets-dir=dir_name | ไดเรกทอรี Character Sets |
--columns=column_list, -c | รายชื่อคอลัมน์ คั่นด้วย Comma (ลำดับ = Mapping กับ File Columns) |
--compress, -C | บีบอัดข้อมูล Client-Server |
--compression-algorithms=value | Compression Algorithms ที่อนุญาต (Default: Uncompressed) |
--enable-cleartext-plugin | Enable mysql_clear_password Plugin |
--force, -f | Ignore Errors (เช่น Table ไม่มี -> ทำต่อ ไม่ใช่ Exit) |