SunQuest
 
           MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old September 10th, 2003, 05:56 AM
prav5110 prav5110 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 5 prav5110 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Mysql Import Textfile

Hi Guys,

I have managed to import CSV files into my MYSQL DB, however there is 1 file having almost 135000 records, I am not able to import this one. when I try importing, it only imports 58000 records. Do u know why?

Thanx

Reply With Quote
  #2  
Old September 10th, 2003, 07:13 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Are there errors when you load it? Could the data be malformed at line 58,0001 or possibly in about 70,000 lines in the file that don't get imported?

Reply With Quote
  #3  
Old September 10th, 2003, 07:42 PM
prav5110 prav5110 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 5 prav5110 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Re:MYSQL

HI Dhouston.

The data is not corrupt. I am sucessfully able to import the same file in ACCESS and it does it without any errors. THis is achieved within a minute, whereas when I try importing it to MYSQL it takes 25 mins for the import and then too imports only 58000 rows.

Reply With Quote
  #4  
Old September 11th, 2003, 06:32 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
prav5110,

How are you importing the file, command line or GUI-based?

What's the code you're using to import the file?
__________________
____________________________________________
Developer Shed Weekly Writer | DevArticles Forum Moderator
Build Your Own KlipFolio Klip With PHP
FrankManno.com - Under Construction
Design Interactive Group - Under Construction

Reply With Quote
  #5  
Old September 11th, 2003, 07:50 PM
prav5110 prav5110 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 5 prav5110 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

I am using a GUI called Navicat. Its really good and am having sucess importing all other tables but this one (the one with 135000 rows).

I have tried a couple of more GUI's and used importing the file with command line using the command

load data infile 'C:\\LucentNonPerfRpts.csv' into table tblluc_non_perf fields terminated by ',' enclosed by '"' lines terminated by '\r\n';

But in all these cases it imports 29000 rows only. I am using a MYISIAM table type.

Its with Navicat that i am able to import 58000 rows,
Do u know how to resolve this?

Reply With Quote
  #6  
Old September 12th, 2003, 07:35 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Try breaking your file up into three files and see if you can import them separately. With nice round numbers like 29,000 and 58,000, I can't help thinking there's some limit set somewhere.

Reply With Quote
  #7  
Old September 12th, 2003, 11:26 AM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Yeah, I'm with DHouston on that... I searched the MySQL site, and couldn't find anything related to import limits; however, it does seem like a "round number" suited to a set limit.

Reply With Quote
  #8  
Old September 12th, 2003, 10:04 PM
prav5110 prav5110 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 5 prav5110 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Guys,

I have checked that out... How to break a CSV file into parts as when u open it it does not display more than 65000 Rows?

Reply With Quote
  #9  
Old September 15th, 2003, 06:54 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Go to row 50,000, press CTRL-SHIFT-END, and then hit delete. Save the top 50,000 rows AS a new file. Close the original doc without saving. Reopen the document. Go to row 50,001, press CTRL-SHIFT-HOME, and then hit delete. Hopefully this'll shift all your rows up. If not, save as a new doc and reopen. Repeat, rinse, etc.

Reply With Quote
  #10  
Old September 18th, 2003, 01:42 AM
prav5110 prav5110 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 5 prav5110 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
HI Guys,

This is not just working!!! My file with 136000 rows, I am able to import it to Ms Access DB. All rows imported perfectly and ths process takes 2 mins. When i do the same to mysql, it only imports 56000 rows and that too in 1 hr.

Could you help!!

Reply With Quote
  #11  
Old September 18th, 2003, 07:27 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Did you try to break it out into separate files?

Have you tried this not within a GUI? Have you tried it at the command line, I mean?

If all else fails, write a little script that reads the CSV file and writes a bunch of insert statements. It'd take a while to run, but it'd get your data in at least, provided the data are well-formed.

I'm running mysql on my Linux box. I wrote a perl script that wrote a CSV file with 7 columns and 136000 rows. I created a database and a table with seven columns and issued the following command at the mysql command line:

Code:
load data infile '/tmp/mytest.txt' into table thetbl fields terminated by ',' enclosed by '"' lines terminated by '\r\n';


It imported all 136000 rows in 0.60 seconds. Definitely try this at the command line instead of through a GUI. If that doesn't work, you'll need to check your mysql settings to make sure there's not some limit set, and then you'll need to check and make sure there's not some weird limitation within mysql on Windows.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > Mysql Import Textfile


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway