load data from text file

Hi,
I have to load data in mysql table from text file | delimited.

Please find following details:

WE have two tables (1) transaction_details and transaction_details_history
(2) we use after insert trigger on transaction_details table to insert records in history table

I am using following command to load data from text file:
LOAD DATA INFILE '/home/pradeep.tiwari/upload/transaction_details_insert_data_new.txt'  
IGNORE INTO TABLE domain_details_insert_test FIELDS TERMINATED BY '|';

got following error:
ERROR 1205 (HY000) at line 1: Lock wait timeout exceeded; try restarting transaction

number of rows in txt file is around 2,00,000 at once.

As per mysql manual its not need ti increase inoodb_wait_time+out variable, vale in my server set to 200.

Please advice me to sorted out the issue.


Thanks,
Pradeep
pradeep_jmdAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pradeep_jmdAuthor Commented:
HI,
transaction_details already have more then 14 millions records.


Thanks,
Pradeep
0
unknown_routineCommented:
First get more info about the error:
mysql> show engine innodb status\G

Open in new window


Then try setting to timeout to a higher value:

SET GLOBAL innodb_lock_wait_timeout = 600; 

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pradeep_jmdAuthor Commented:
Hi,
I have tested in different way,
(1) I have create a test table and load data into it by text file with around 200000 records and its take only seconds to load.
(2) use insert into select * from test table and it also take seconds to commit.

Problem.

But when same thinks apply on transaction table its take hours to load.

The transaction table already have 14 millions of records.

Please suggest the possible way to load data in sort time.


Thanks,
Pradeep
0
pradeep_jmdAuthor Commented:
Hi,
Also triggers on transaction table to load data on history table too.

Is trigger take time to load?

Thanks,
Pradeep
0
pradeep_jmdAuthor Commented:
Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.