• 0

MySQL Query Insert 100,000 Rows


Question

Hi,

I am using SQL Manager for MySQL (EMS) and generated a backup of my database. For each table I am grabbing about 100,000 records per block.

So, in the SQL Script it has INSERT x,y,z VALUES (1,2,3),... 100,000 times and then the next block.

The problem is MySQL is chocking and I get the error: "MySQL has gone away"

My guess is the problem probably is that it's either timing out (probably not since it gives me the error in under 2 seconds) or I have to configure MySQL

to handle all those inserts in one shot.

Any ideas?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Import table from backup to live as tablename_backup, then use a INSERT INTO FROM SELECT to select all values from backup table into your live one, this should work more efficiently.

Link to comment
Share on other sites

  • 0

Yeah no worries, I do this type of thing a lot at work ;)

It got to the point I was doing it so often I've made a .net app which takes does this job for MySQL or MSSQL databases... :p

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.