Jump to content

Field 1 Corrupt


grantf

Recommended Posts

Hi, i am just starting out with mySQL and i am trying to load data into a new table. By following the guide this is what i have typed.

 

LOAD DATA LOCAL INFILE 'c:\file.csv' INTO TABLE people

FIELD TERMINATED BY ',';

 

i then get this as a responce

 

Query OK, 5 rows affected (0.02 sec)

Records: 5  Deleted: 0  Skipped: 0  Warnings: 0

 

then... when i SELECT * from people;

 

the first field out of 3 fields is missing characters, see below

 

+--------+-----------+------------+

| name  | city      | country    |

+--------+-----------+------------+

| ohn  | sydney    | australia

  | er  | melbourne | america

  |    | adelaide  | england

    |  | perth    | spain

    | e | brisbane  | italy

+--------+-----------+------------+

5 rows in set (0.00 sec)

 

this is a copy of the orignal data

 

john,sydney,australia

peter,melbourne,america

bob,adelaide,england

alex,perth,spain

george,brisbane,italy

 

the source file is very basic, created in excel and saves as csv file, double checked in notepad++

 

Does anyone know what i am doing wrong??

Link to comment
https://forums.phpfreaks.com/topic/93090-field-1-corrupt/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.