mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table
Trying to dump and reload a large (multi-hundred GB) database via a pipe, was failing with that error.
Most of the pages on the internet fail to find any useful resolution, most suggesting that you try altering the timeouts on the destination server. It turns out that it's caused by timeouts on the source server. After loading the data, mysql re-enables the keys, and stalls while this is done. If the index rebuild takes longer than the value of net_{read,write}_timeout on the source server, then it drops the connection. The solution is (on the source server, that mysqldump is reading from):
This is the case, even if you're reading from a UNIX domain socket.
It works when you're writing to a file, because the file write doesn't stall for the same length of time, and of course, files don't care how long it is between reads.
Trying to dump and reload a large (multi-hundred GB) database via a pipe, was failing with that error.
mysqldump [stuff] | mysql [other stuff]
Most of the pages on the internet fail to find any useful resolution, most suggesting that you try altering the timeouts on the destination server. It turns out that it's caused by timeouts on the source server. After loading the data, mysql re-enables the keys, and stalls while this is done. If the index rebuild takes longer than the value of net_{read,write}_timeout on the source server, then it drops the connection. The solution is (on the source server, that mysqldump is reading from):
set global net_write_timeout = 28800; -- Or something more suitable set global net_read_timeout = 28800; -- Or something more suitable
This is the case, even if you're reading from a UNIX domain socket.
It works when you're writing to a file, because the file write doesn't stall for the same length of time, and of course, files don't care how long it is between reads.
I've seen many weird and wacky ways of creating an audit trail in databases, some better than others. The basic requirements are that users are able to do their jobs, but aren't allowed to do anything they aren't supposed to. And that what they do is logged usefully, securely, and automatically.
Whilst this one would need tidying up for a live system, it seems to be the best approach:
( Auditing in Postgres )
I now have two broken landrovers in the barn, and no working ones :-(
Rather than having a snuggly early night last night, a fair amount of it was spent waiting for the AA. If I can get a timing belt today, the weekend may still happen...
If the subject line means anything to you, you know what else has happened today. If you don't, then feel free to ignore it as pointless geekery :-)
Rather than having a snuggly early night last night, a fair amount of it was spent waiting for the AA. If I can get a timing belt today, the weekend may still happen...
If the subject line means anything to you, you know what else has happened today. If you don't, then feel free to ignore it as pointless geekery :-)
Late January/early February seems to be a time for change. This year, at least. For all the changes that happened at the end of last year, there seem to be many more happening just now, allbeit with a lot less publicity. A number of them were fairly inevitable, but always with a twist that I didn't see coming. Some of which I'm very close to, and some of which I'm not and can only pass on hugs to those who are.
Which is not to say that everything is doom and gloom, there are a lot of positive changes happening at the moment too and a number of those hugs are celebratory ones.
Speaking of hugs, I can't make it to
iintemporaliter's party tonight, but I may manage to pop in for a drive by hugging. I suspect it might be good for both of us.
Which is not to say that everything is doom and gloom, there are a lot of positive changes happening at the moment too and a number of those hugs are celebratory ones.
Speaking of hugs, I can't make it to
( Portraits of Tim )
- Location:Home.
- Mood:
relaxed
It appears I may have just bought another Land Rover (in this case for
torsparkles rather than for me). A series 1 with a rollcage and an inoperative engine. Now we just need to make more than one of them work at the same time...
- Location:Work
- Mood:
tired
Just a resized dump from the camera, picking, choosing, and prettifying will happen later. As you can see, the main problem was getting the autofocus to cooperate...
http://www.rasilon.net/photos/2006-07-24/
http://www.rasilon.net/photos/2006-07-24/
- Location:Work
Whilst the new project Orion is very good news, the original project Orion being restarted would have been better news.
- Location:At home
- Mood:
drunk - Music:Classic FM
Um, I'm now a bit sozzled after a bottle of wine and some Ardbeg, so rather than trying to post something coherent I'll mostly just point you at http://torsparkles.livejournal.com/31367 7.html.
In case you aren't able to see it,
Tor and I are engaged and are getting married some time this year.
A more coherent post will follow when I'm more coherent, and able to type properly. (I spellcheck, which is why this looks vaguely sane.)
In case you aren't able to see it,
Tor and I are engaged and are getting married some time this year.
A more coherent post will follow when I'm more coherent, and able to type properly. (I spellcheck, which is why this looks vaguely sane.)
- Location:the sofa
- Mood:
happy - Music:classic fm
A function to replicate arbitrary postgres table operations to other databases (any sensible database supported by DBI).
( Fairly dense perl follows )
( Fairly dense perl follows )
- Mood:
geeky - Music:Classic FM
I was planning to try to sort the rear axle this weekend, but it would appear a more urgent job has imposed itself. Fifth gear is now lying by the side of the A68 just south of St Boswells. Thus the return journey was a little slower than might have been anticipated.
In other news, when replacing a knackered contact lens with a fresh one, it pays to be careful. Instinctively putting it in your right eye because that's where you always start has a 50% chance of being a stupid thing to do. Thus I can safely say that it is a lot harder to get the additional lens out than the normal one.
Similarly, when leaving the house, it pays to check that the sunglasses case actually contains the sunglasses.
Additional minor arghness that I can't be bothered listing.
Bullet pointed randomness:
It appears there has been some drama of late. Hugs to those who need it.
In other news, when replacing a knackered contact lens with a fresh one, it pays to be careful. Instinctively putting it in your right eye because that's where you always start has a 50% chance of being a stupid thing to do. Thus I can safely say that it is a lot harder to get the additional lens out than the normal one.
Similarly, when leaving the house, it pays to check that the sunglasses case actually contains the sunglasses.
Additional minor arghness that I can't be bothered listing.
Bullet pointed randomness:
- The Accuracy International website no longer has photos, or indeed much of anything.
- I now know how a Thermic Lance works. And it's mildly cunning.
- So is arc welding under water -- I'd always assumed it wouldn't work.
- Land Rovers can still smell of Dog, even when they've been sitting in the scrap-yard for a year with only half their windows.
It appears there has been some drama of late. Hugs to those who need it.
- Mood:
tired
Happy Birthday Claire
Some of you may remember that the european balloon festival in France was mostly rained off this year, but during the flyable slots I managed to get a few photos. Gallery Here
See subject...
Hugs all.
Now to sleep for a bit.
Story to follow.
Now to sleep for a bit.
Story to follow.
Quick Summary:
It's hot, the weqther is perking up q bit qbd I hqte azerty keyboqrds;;;
It's hot, the weqther is perking up q bit qbd I hqte azerty keyboqrds;;;
With something resembling hardware support for function calls, stacks and that sort of thing, it seems sensible to implement a stack for parameters and local variables. On the other hand, there is only hardware support for 8 levels of function call, and there's only 64 bytes of RAM in total, which kind of puts a crimp on recursion.
Why does the cat think thermocouples make good eating?
The bits I didn't forget to order from RS turned up today, and it would appear that the cat really likes chewing on armoured cable.
I think the SMT components had better go in a box, since I don't think I'd have time to notice him scoffing them.
The bits I didn't forget to order from RS turned up today, and it would appear that the cat really likes chewing on armoured cable.
I think the SMT components had better go in a box, since I don't think I'd have time to notice him scoffing them.