Reputation: 91
i have a txt file with around 0.8 million rows in it. i want to import it into SQL. i have tried converting it into CSV as well. but excel is not allowing 0.8 million rows at a time.
Upvotes: 1
Views: 465
Reputation: 12069
Use mysqlimport
Something like
mysqlimport --columns='co_no,pd_ch' my_db sample.txt
Probably have to play around with it to get it working.
Upvotes: 2
Reputation: 34677
Try a simple LOAD DATA command. Assuming your example data is in sample.txt
and you have the necessary permissions, it should be accomplished from the shell as:
LOAD DATA INFILE 'sample.txt' INTO TABLE sqlTable FIELDS TERMINATED BY ',' ENCLOSED BY '"'
Upvotes: 3
Reputation: 1839
Using MySQL Workbench will help you a lot. If you need to modify the file first, use a scripting language such as Python. Excel is not a good option for that much data.
Upvotes: 0