Find your slow mysql queries

December 2, 2010

MySQL can show you what queries are taking the most time to run on your system, so that you can optimize if you need to do so So connect to the mysql cli (make sure the user mysql is running as has enough privileges) and then enable slow query as shown below:

mysql>  set global slow_query_log_file="/tmp/mysqld-slow.log";
mysql>  set global slow_query_log=1;

Comments

comments powered by Disqus