Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7443079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:16:32+00:00 2026-05-29T11:16:32+00:00

I tried to load huge data file eg 10 mb files into the db

  • 0

I tried to load huge data file eg 10 mb files into the db using Load Data Local Infile into mysql using a windows service. But it failed and the windows service stopped without any exception. I tried with files of small size such as 2 mb and it succeded.

Is there any way I can load huge files into the mysql db? And what may be the reason for the windows service to stop?

here is my code..

    public int UpdateDataBase(string query, string filename, Logger swLog)
    {
        int status = 0;

        using (MySqlConnection myconnection = new MySqlConnection(connectionCdrBank))
        {

            try
            {
                myconnection.ConnectionTimeout = 1000;
                myconnection.Open();
                myconnection.BeginTransaction();

                MySqlCommand mycommand = new MySqlCommand("ClearTempTable", myconnection);
                mycommand.CommandType = CommandType.StoredProcedure;
                status = mycommand.ExecuteNonQuery();

                MySqlCommand mycommand1 = new MySqlCommand(query, myconnection);
                mycommand1.CommandTimeout = 1000;
                status = mycommand1.ExecuteNonQuery();

                MySqlCommand mycommand2 = new MySqlCommand("InsertToCdrDetailsTempTable", myconnection);
                mycommand2.CommandType = CommandType.StoredProcedure;
                mycommand2.CommandTimeout = 1000;
                status = Convert.ToInt32(mycommand2.ExecuteScalar());

                myconnection.Commit();
                myconnection.Close();

            }
            catch (Exception ex)
            {
                Console.WriteLine("Error:" + ex.Message);
                if (myconnection.State == ConnectionState.Open)
                    myconnection.Rollback();
                status = (ex.Message.IndexOf("Duplicate entry") != -1) ? -1000 : 0;
                swLog.WriteErrorToLog("");
                swLog.WriteErrorToLog("Error while saving: " + ex.Message);
                mail.SentMail("Error while saving:", ex.Message);
                swLog.CloseLogger();
            }
        }

        return status;
    }

where query is

LOAD DATA LOCAL INFILE 'a.txt' INTO TABLE tbl_cdrload" FIELDS TERMINATED BY ',' LINES     TERMINATED BY '\n';
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:16:33+00:00Added an answer on May 29, 2026 at 11:16 am

    I’m loading up to 100 MB files into MySQL Blob fields. And this is just my artificial limit.

    So, 10MB files should not be a problem.

    Did you set max_allowed_packet correctly?

    What do you use to load the files? Your own code or some tool? What MySQL Connector?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I load a custom dll file in my web application? I've tried
I'm struggling to get sqlldr to import a csv data file into my table,
I am facing a big issue with PDFBOX: I tried to load a file
How can I insert huge BLOBs into a MySQL database (InnoDB)? Fields of type
I tried to load the flash using webview, it does not work on emulator
I tried to load test.html in Chrome but saw nothing. But in Firefox, I
I tried parsing this huge XML document using XML minidom . While it worked
i have tried load and hebrew didn't work for me so i changed my
I tried the following: $.load(Views/chatBox.html).appendTo('body') Console Output: TypeError: $.load is not a function EDIT
I tried one of the examples here to load the content in the div,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.