[UPHPU] FW: Importing large csv file into MySQL

emails at boucha.us emails at boucha.us
Thu Mar 18 21:14:16 MST 2004


I had the same problem you're having. Either your web server or php.ini
have a limit on the size of files a user is allowed to upload. This limit
is like 5 megs or 9 megs. Check your php.ini. This is to prevent someone
from uploading a huge file, like a cd iso or something, when you only
wanted a photo or avatar or something.

When you import through phpMyAdmin you are in actuality uploading your
file. You can split your file into smaller chunks, but your best bet is to
ftp your file to your server, if your server is not local, and import your
file with the MySQL command line. The MySQL documentation is pretty
detailed on how to do that.

> I would guess that phpMyAdmin runs out of allowed execution time. What
> kind of  error do you get? At any rate, I would do what the others
> suggest and import it  from the command line.
>
> Ashley Oviatt wrote:
>> I sent this accidentally to just Mac, and now here it is again for all
>> of you:
>>
>>
>>>Hello all,
>>>
>>>I have a large csv file (1 million records) that I need to
>>>import into a mysql database. I have tried phpMyAdmin's
>>>import utility but it always errors out after a couple
>>>minutes of processing. It works if I take 10,000 records out
>>>of the csv as a test import, so I know my syntax is correct.
>>>
>>>I'm guessing the csv is corrupted down the line somewhere, so
>>>I tried to import it into MS Access. Low and behold it
>>>worked. So now I have the csv DB in Access and can connect to
>>>the MySQL DB via an odbc connection.
>>>
>>>So I just need to know how to copy the csv table into the
>>>mysql table. It will only let me copy about 30,000 records at
>>>once without saying memory is all used up.
>>
>>
>> Mac suggested that I import it directly from the command line mysql.
>> Do any of you have the syntax for that?
>>
>> Ashley
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: list-unsubscribe at uphpu.org
>> For additional commands, e-mail: list-help at uphpu.org
>>
>>
>>
>>
>
>
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: list-unsubscribe at uphpu.org
> For additional commands, e-mail: list-help at uphpu.org






More information about the UPHPU mailing list