2

what is the fastest method to upload a csv file into mysql via perl, mysql?

The csv file is probably about 20Gs.

thanks

3
  • A better question would be why you would ever want to do that. Commented Mar 2, 2012 at 16:41
  • 2
    Restoring a backup, migrating DB hosts, set up a test instance, prepare for stress test evaluation, … Commented Mar 2, 2012 at 16:45
  • I'm with Brian - why do this through Perl? What's wrong with the standard loader or a purpose-built bulk-loader tool? Commented Mar 2, 2012 at 16:55

2 Answers 2

12

consider using mysql LOAD DATA INFILE

http://dev.mysql.com/doc/refman/5.0/en/load-data.html

Sign up to request clarification or add additional context in comments.

Comments

1

You could use Perl and DBI to execute a LOAD DATA INFILE statement, if for some reason you couldn't use the mysql client or mysqladmin.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.