59 s for just simple select command mysql&gt; select  count(*) from num;
+----------+
| count(*) |
+----------+
|  9918530 |
+----------+
1 row in set (59.18 sec)


It is horrible, 59.18 sec for just a simple select command!
How to improve MySQL performance in my windows10?
With ENGINE=InnoDB, the entire table must be scanned to perform the count.  Actually, any index can be used, and the Optimizer picks the smallest index (or the PRIMARY KEY if no secondary indexes exist.

If the table (or index) is not currently cached in the buffer_pool, then the query will take longer because of all the I/O necessary.

The reason for having to touch all the rows is that there could be other connections adding/deleting rows during the count, and InnoDB is obligated to provide the answer that is compatible with various transactional integrity requirements.  (Your Question has been asked many times; other Answers may provide more details.)