The method of opening Spotlight on MySQL-Slow Query Log
The thing begins with questions from friends:
Seeing this problem, I first thought of the possibility that the tool was not connected properly, but he quickly ruled it out.
Then I asked him if the slow query switch was turned on.
If it is not turned on, then execute: set global slow_query_log=on;, he also took care of this quickly.
I asked him how much the slow query time was set (I suspect he set it too long so he didn't log it) and he said 1 second.
I asked if I could confirm that there was a qualified slow query, and he said that it did exist after reading the log.
At this time, I began to feel the problem and quickly start Spotlight to connect to the MySQL in the virtual machine.
It is found that Slow Query Log really does not have the data. The fork installation is about to fail, but it must not easily admit defeat.
After crazy Baidu has changed the following two points:
1. Turn on General Log
two。 Add settings under [mysqld] in the my.cnf configuration file:
Then restart MySQL and reconnect to Spotlight to view Slow Query Log:
So far, it is declared that the fork has been installed successfully.
Article source: http://blog.163.com/lucia_gagaga/blog/static/264768019201681931238833/
Postscript: 1. Personally, I don't think it is necessary to turn on general_log, which affects the performance of MySQL.
two。 For online, it is troublesome to modify static parameters to restart the database, such as applying for suspension of business, so you should think of it in the early planning.