MySql Slow Queries
MySQL has a slow query log which can be enabled if you want to identify the queries that are causing problems for a website or application. Checking slow queries is one of the most important steps in optimizing and tuning mysql. This article shows how to identify those 'slow queries' that need special attention and proper optimization. First let’s check on the server if slow query logging is enabled on MySql. On Windows cd c:\xampp\mysql\bin bin>mysqladmin var | find "log_slow_queries" On linux bin>mysqladmin var |grep log_slow_queries Enable the slow query log MySQL prior to 5.1.0 requires a change to the MySQL my.cnf file and a restart in order to log slow queries. From MySQL 5.1.0 you can apparantly change this dynamically without having to restart. Too make the change permanent, you could add the following lines under the [mysqld] section of your my.ini or my.cnf configuration file: >vi /etc/my.cnf [mysqld] # Activate the Slow Q...