スクリーンショットを参照してください:http://img19.imageshack.us/img19/7336/82051321.pngおよびhttp://img27.imageshack.us/img27/2935/24285862.png
問題は「アプリケーションコード」にあります。LOAD DATA INFILEを、Windowsスタイル(\ r \ n)の行末を持つファイルで使用しており、特に指定しない限り、mysqlのデフォルトはunixスタイル(\ n)です。
私が何を意味するかを確認するには、これを試してください:
mysql> load data infile 'data.txt' into table testDel (val);
Query OK, 6 rows affected (0.01 sec)
Records: 6 Deleted: 0 Skipped: 0 Warnings: 0
mysql> select * from testDel;
+----+----------------+
| id | val |
+----+----------------+
| 7 | hello world 1
| 8 | hello world 2
| 9 | hello world 3
| 0 | hello world 4
| 1 | hello world 5
| 12 | hello world 6 |
+----+----------------+
6 rows in set (0.00 sec)
mysql> select id, hex(val) from testDel;
+----+------------------------------+
| id | hex(val) |
+----+------------------------------+
| 7 | 68656C6C6F20776F726C6420310D |
| 8 | 68656C6C6F20776F726C6420320D |
| 9 | 68656C6C6F20776F726C6420330D |
| 10 | 68656C6C6F20776F726C6420340D |
| 11 | 68656C6C6F20776F726C6420350D |
| 12 | 68656C6C6F20776F726C642036 |
+----+------------------------------+
6 rows in set (0.01 sec)
何が起こっているのかというと、\rが値の表示を覆い隠しているということです。テーブルの「壁」がどのように並んでいないかに気づきましたか?これは、「壁」が並んでいるhex(val)を使用したクエリから明らかなように、表示に問題があることを示唆しているはずです。
インポートを修正するには、ファイルの行末を指定する必要があります。
mysql> load data infile 'data.txt' into table testDel lines terminated by '\r\n' (val);
Query OK, 6 rows affected (0.00 sec)
Records: 6 Deleted: 0 Skipped: 0 Warnings: 0
mysql> select * from testDel;
+----+---------------+
| id | val |
+----+---------------+
| 13 | hello world 1 |
| 14 | hello world 2 |
| 15 | hello world 3 |
| 16 | hello world 4 |
| 17 | hello world 5 |
| 18 | hello world 6 |
+----+---------------+
6 rows in set (0.00 sec)