4

My debian-based is booting so slow after I installed MySQL and imported some databases on it. Looking for some statement, I found this one during boot:

mysql> show full processlist;
+----+------------------+-----------+------+---------+------+----------------+----------------------------------------------------------------------+
| Id | User             | Host      | db   | Command | Time | State          | Info                                                                 |
+----+------------------+-----------+------+---------+------+----------------+----------------------------------------------------------------------+
|  9 | debian-sys-maint | localhost | NULL | Query   |   12 | Opening tables | select count(*) into @discard from `information_schema`.`PARTITIONS` |
| 10 | root             | localhost | NULL | Query   |    0 | NULL           | show full processlist                                                |
+----+------------------+-----------+------+---------+------+----------------+----------------------------------------------------------------------+
2 rows in set (0.00 sec)

Here the statement that causing trouble:

select count(*) into @discard from `information_schema`.`PARTITIONS`

I have +-10 databases totaling over 8gb of data.

Is there any configuration to disable this query on system booting ? If yes, why run it during boot ?

Information

I have a standard MySQL installation without custom configs.

Best regards.

3
  • If you run the slow query in questio what's the execution time you get back? What's the result of the count? (ie how many tables do you have?)
    – Erik
    Sep 24, 2012 at 14:53
  • Hi Erik, the result of query is: '4955' (36.40 sec) Sep 24, 2012 at 16:47
  • Counting manualy, the total of tables in all databases is 5000...this query counts number of tables ? What can i do to reduce/stop this ? Sep 24, 2012 at 16:49

1 Answer 1

8

It seems Debian, whose Linux Mint is based upon, have scripts that get executed when the mysql server is started or restarted, to check for corrupted tables and make an alert for that.

In my Debian server, the culprit seems to be /etc/mysql/debian-start bash script, which in turn calls /usr/share/mysql/debian-start.inc.sh , so check both scripts and comment out the function that is iterating all your tables, from a quick look it seems the following:

check_for_crashed_tables;

which is called from the debian-start script I mentioned above.

4
  • 1
    Nelson, perfectly! I'm was commented this argument and works fine here! ;) Thanks. Sep 24, 2012 at 17:31
  • I'm glad you could fix it :-)
    – Nelson
    Sep 24, 2012 at 17:34
  • From +- 3 minutes to less than 1 minute to start my station ;D #nice #nice Sep 24, 2012 at 17:57
  • +1 same on ubuntu ... I have more than 21 gb of database on my Magento local DEV enviroment and when I start mysql first 5 minute I have a lot of io wa, commenting above line save me every morning when I start to work :)
    – WonderLand
    Dec 31, 2013 at 15:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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