I'm trying to import a dump ~500MB, ~300 tables using the SOURCE command from withing the MySQL command line environment. Everything seems to go well with tables being created and being filled with data, but then at some point it just freezes.

Opening up another MySQL command line and checking SHOW FULL PROCESSLIST, shows

| 13458 | someuser | localhost | mydatabase | Sleep| 11639 |      | NULL |

If I try and change to mydatabase and issue a SHOW TABLES, that command also freezes and if I open up a third command prompt, and issue a SHOW FULL PROCESSLIST, in addition to the original sleeping process I get the line:

| 13675 | someuser | localhost | mydatabase | Field List |  7861 | Waiting for table flush | |

I've set tee session.out for logging, but the last three lines in the log file are:

Query OK, 0 rows affected (1.24 sec)

Query OK, 0 ro

that is, the last line is truncated as shown above.

If someone knows what is wrong and how to fix it, that would be fantastic, but failing that, any advice on debugging this further would be appreciated.

  • Is there any reason you use SOURCE command? – HamoonDBA Jul 9 '17 at 5:04
  • 300MB will take time; did it ever finish? SHOW will stall due to locked tables (or something like that). SHOW PROCESSLIST; is likely to be useful. Or you can look in the file system. – Rick James Jul 10 '17 at 15:47
  • @HamoonDBA Only reason I'd used SOURCE originally was so I could see where it was getting stuck. Any reason why using source might cause this? – Dom Jul 10 '17 at 19:33
  • @RickJames It felt like it was locking up. When I looked at the file sizes of the tables on disk, they weren't growing. Also, I did use SHOW FULL PROCESSLIST, which I've documented in my question. – Dom Jul 10 '17 at 19:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.