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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.