Importing large text files into MYSQL

Posted on 2012-09-09
Last Modified: 2012-09-13
I am importing a series of text files given to me by the local chamber of commerce.  There are about 30 files.  Some are very small and some are very, very large.  The small ones import with no issue but the very, very large ones are timing out at 650 seconds each time.  Not sure if this is a limit imposed by MYSQL or if there is a way to batch the file so it only processes so many records at one time and can chug through these large files.
Question by:pwbigdawg

    Author Comment

    Exact error is Error code 2013. Lost connection to MySql server during Query.  The duration each time is 600.500 sec.

    Query being used is:

          fields terminated BY '\t'
    LVL 24

    Accepted Solution

    It looks like you have a wait_timeout setting of 600 seconds.  You can confirm this by doing a "show variables like 'wait_timeout';"

    You can change it just for your current session via something like "set wait_timeout=1200;"

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Suggested Solutions

    Introduction In this article, I will by showing a nice little trick for MySQL similar to that of my previous EE Article for SQLite (, A SQLite Tidbit: Quick Numbers Table Generation (…
    Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
    This video discusses moving either the default database or any database to a new volume.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now