Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I tried to run a data migration query on a live database server, and after a minute, I could not connect to MySQL via the command line due to "Too many connections." I had to kill the query and restart MySQL. I won't try to run such a query on a live system during the day, again :)

This same query took less than two minutes on very low-traffic copy of the production server, finishing fine.

Is it likely that the traffic to the server would have made this query stall?

share|improve this question
add comment

1 Answer

I have a hunch that the problem you ran into was related either to FLUSH TABLES or LOCK TABLES, presuming you are using mysqldump or something similar to do your migration. mysqldump without throwing --single-transaction presumes a MyISAM table type and locks the table to prevent any new writes while dumping so that you get a consistent snapshot. If you are using InnoDB tables and turn on --single-transaction then one of the first queries that is executed is flush tables which closes and reopens all the tables in the database so that you get a consistent snapshot across tables. Either can cause incoming queries to pile up waiting for locks to free but probably wouldn't be noticeable on your lightly loaded replicant.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.