Jump to content

Archived

This topic is now archived and is closed to further replies.

xgab

Cannot import into MySQL

Recommended Posts

Hi!

This is my first experience importing comma, pipe or tabs delimited plain files into a MySQL Database.

 

I tried using more than one tool and none of them worked...

 

The thing is that one of the plain files has 250,000 records.

 

- I tried with a nice freeware script called CSV Importer. It enabled me to import succesfully one plain file of 6,000 records, but the second one has 24,000 and it uploaded only 8,000 (so the largest one will be imposible). Does anyone ever used CSV Importer ? (downloaded from hotscripts.com)

 

- Then I tried with the latest PHPMyAdmin system. It is very clear how to export information, but I could not figured out how to import!. There is an import link at the little SQL window that asks me for a txt file, but it is not clear how to format and process it.

 

- I also tried with a Windows freeware to create the .sql file from Access. It created a huge file with many INSERTs. How should I process that big file, thru the little PHPmyAdmin SQL window ???

 

- Finally I tried with LOAD FROM and mysqlimport, but... unfortunately I get many errors and warnings and the help information at the mysql site is not enough for me... I a newbie :-(

 

Which is the best option or technique to import large amounts of records ?

 

The server I use is Linux Mandrake with PHP 4.3.3, the latest MySQL and also my PC is Windows XP.

 

I will apreciate you help. Than you!

Share this post


Link to post
Share on other sites

i am only familiar with importing via the LOAD command, or by using a redirect at the command line. have you tried that? i think this is correct:

 

./mysql databasename < file.sql

 

what kind of errors and warnings do you encounter?

Share this post


Link to post
Share on other sites

Have you tried the sqlyog tool www.sqlyog.com

 

It helps you in imoprting data easily GUI based

 

This is the command to import csv file

 

LOAD DATA INFILE <Filename with path> INTO TABLE <table_name> FIELDS TERMINATED BY \',\' LINES TERMINATED BY \'n\' 

Share this post


Link to post
Share on other sites

Go with the big \'inserts\' file and the little SQL window!

It isn\'t the size of the file, its the length of the inserts statement that matters - if it will handle one, you can batch process the rest.

 

Better yet, write a php script to handle it all. Whichever way you choose, its going to be time consuming importing it all, in terms of machine cycles. Might as well bite the bullet and kick it off, it may well be done before you can find a faster method, and I\'m assuming that this is something you\'ll only have to do the once!

 

Oh yes, and check your backup policies too, make SURE you only have to do it once! *grin*

 

Good luck with it!

 

D

Share this post


Link to post
Share on other sites

I have found a freeware version of SQLyog !

 

The current published on-line version 3.2 is paid... but version 3.1 is still freeware!

 

 

Thank you all!

Share this post


Link to post
Share on other sites

×

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.