Jump to content

Problem importing CSV into table


ianhman

Recommended Posts

Hi,

I am a complete newbie to MySQL!

I am trying to import a CSV file using phpMyAdmin.

I have uploaded the CSV file via FTP to the root directory on my external server (GoDaddy). According to GoDaddy they allow importing of files into MySQL so there must be something wrong with my query.

In phpMyAdmin I ran the following query:
[code]
load data local infile 'resdatatest2.csv' into table tblNewsletterSubs
fields terminated by ','
lines terminated by '\n'
(ID, EcastID, Email)
[/code]

One the query has run phpMyAdmin then says the file has imported but with "Inserted rows: -1"
so no actual data is being imported. It should have imported 284 rows, not -1 !

The tblNewsletterSubs table structure is as follows:

ID - int(7)
EcastID - int(3)
Email - varchar(75)


I have attached a file sample of the CSV file I am using, I have stripped it down to 3 rows for test reasons. I can't see what is going wrong?

Please help  ???

[attachment deleted by admin]
Link to comment
Share on other sites

I ended up having to convert the CSV file to an SQL file and insert the data that way by via the Import option on phpMyAdmin. Not ideal as this option only handles file up to 2MB in filesize on the host (GoDaddy) server.

Earlier I mentioned to my host (GoDaddy) that I was trying to import a CSV file and showed them the query I was using. GoDaddy said they do support CSV import and that there was something wrong with my query??

If anyone can provide further help it would be much appericated.
Link to comment
Share on other sites

  • 3 weeks later...
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.