Avatar of liz1976
liz1976

asked on 

how do i upload large csv file to phpmyadmin?

hi,

i have a database table structure all set up in phpmyadmin but with no records in it. all the records are in a 200MB .csv file (67MB when zipped) on my local drive. i'd like to find a simple way of uploading this data as i'm going to have to re-upload files of this size fairly frequently and the phpmyadmin import tool has a limit of about 50MB (and it doesn't seem to work when i try to upload zipped files). i've tried using the free  'bigdump' tool  to split the huge csv file up but i think it only works with .sql databases and not .csv files?

i'd be very  grateful for any advice!
thanks,
liz

p.s. it's getting late here in london so i'm not going to last much longer but i'll check back first thing in the morning!
MySQL Server

Avatar of undefined
Last Comment
liz1976
Avatar of Roxxor
Roxxor
Flag of Spain image

You could use something like (SQL command):

LOAD DATA LOCAL INFILE 'c:/file.csv' INTO TABLE yourtable FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r\n'; 

Open in new window

Avatar of liz1976
liz1976

ASKER

thanks both for your replies. i've been trying to upload the file via the attached sql statement and am not having any luck. i keep getting the following error message:

#2 - File 'c:/testliz.txt' not found (Errcode: 2)

i got the same error message when i tried the following variations:
'c://testliz.txt'
'c:\testliz.txt'
'c:\\testliz.txt'

any ideas? also is there any way to upload a .zip file rather than a .txt file, just to save time?

thanks,

liz


LOAD DATA LOCAL INFILE 'c:/testliz.txt'
INTO TABLE DataNew
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'; 

Open in new window

Avatar of Roxxor
Roxxor
Flag of Spain image

Is the path to the file correct?

I cannot remember since I last imported a cvs file to a database, but maybe you should use double slashes, like c://Document and settings//...//testliz.txt in the path. Try it!

You could also test by saving the cvs data to a plain text file (you can do it with Excel and then import it to mysql with:

LOAD DATA INFILE 'path/testliz.txt ' INTO TABLE yourtable
Avatar of liz1976
liz1976

ASKER

hi roxxer,

thanks for your comment again but that's what i was trying. the file is definitely in the right place and i've tried all the combinations of back and forward slashes i can think of. i'm still having a real nightmare actually - have been trying to get the bigdump tool to work most of the day and it doesn't seem to like my csv file. i'd be grateful if anyone had any other ideas...

thanks again,

liz
SOLUTION
Avatar of Roxxor
Roxxor
Flag of Spain image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of liz1976
liz1976

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
MySQL Server
MySQL Server

MySQL is an open source, relational database management system that runs as a server providing multi-user access to a number of databases. Acquired by Oracle in 2009, it is frequently used in combination with PHP installations, powering most of the WordPress installations.

49K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo