importing files
Posted by: bad_position (---.direcpc.com)
Date: October 17, 2007 07:03PM

Hi,

I'm new to wamp and have been figuring things out. But I'm stuck, I have comma delimited file that I'm trying to import in the my database table but, I keep getting this error:

"Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 5861456 bytes) in C:\wamp\phpmyadmin\libraries\unzip.lib.php on line 324"

Anyone have any ideas on how to correct this?

This is a project from my job that I'm stumbling my way through. The overall project is a customized shopping cart. The file is a list of parts that we have available that was pulled out of an SQL database and stripped down to 3 basic fields. Any help or suggestions would be greatly appreciated.

Options: ReplyQuote
Re: importing files
Posted by: yfastud (72.236.169.---)
Date: October 17, 2007 09:36PM

You might want to install that shopping cart in your system first, and to import db, try these different settings in c:\wamp\apache2\bin\php.ini

find:
post_max_size = 8M
upload_max_filesize = 2M
max_execution_time = 30
max_input_time = 60
memory_limit = 8M

change to:
post_max_size = 750M
upload_max_filesize = 750M
max_execution_time = 5000
max_input_time = 5000
memory_limit = 1000M

And add this to c:\wamp\mysql\my.ini:

max_allowed_packet = 200M


Have fun,

[test.jlbn.net] (Sample Testing Codes for PHP, MySQL, ASP.net, SQL, JSP)
[www.jlbn.net] (Basic Guide for WAMP & Add-ons)




Post Edited (10-17-07 21:40)

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: importing files
Posted by: toivo (203.19.130.---)
Date: October 17, 2007 10:50PM

Hi,

Here is some information about importing text files: if you have alpha fields like names or addresses which can contain commas, you would be better off using tab as the field separator, instead of comma (CSV). In that case, you do not have to worry about stripping quotes from around alpha fields either. If you receive a spreasheet as a CSV file, save it as a tab delimited text file before importing.

The following command will import a tab delimited text file into a working table, from which you can subsequently produce the final version of the data:

LOAD DATA LOCAL INFILE "c:/temp/myfile.txt"
INTO TABLE `wwwtest`.`mytable_in`
IGNORE 1 LINES

The last line will just skip the line containing the field names. You can use the command in the Query browser of MySQL Administrator or PHPMyAdmin, or as a query in a PHP command line script, or just an online script.

Make sure you sanitize the raw input data stored in the working table and use the addslashes command for every alpha field before you store them into the actual database table.

Regards,



toivo
Sydney, Australia

Options: ReplyQuote


Sorry, only registered users may post in this forum.