Take a look at the picture
+----+------+-----------+------+------------+------+-------------------------+--------------------------------- -------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------+------+------------+------+-------------------------+--------------------------------- -------+
| 1 | Root | localhost | Test | Query | 78 | User Sleep | Select Sleep (+), id from MY_TEST1_0 |
| 9 | Root | localhost | NULL | Query | 71 | Waiting for Table Flush | Flush Tables |
| 10 | Root | localhost | Test | Field List | 24 | Waiting for table Flush | |
| 11 | Root | localhost | NULL | Query | 0 | init | Show Processlist |
+----+------+-----------+------+------------+------+-------------------------+--------------------------------- -------+
If you have a long-running statement that blocks the flush tables running, all subsequent statements will be blocked by this flush tables.
Flush tables It's so dangerous.