MySQL Slow Query Log i used to find SQL query that are slow. To enable Slow Query Log, add following to /etc/my.cnf file under [mysqld] section.
1 2 3 | [mysqld] log_slow_queries = /var/log/mysql/mysql-slow.log long_query_time = 2 |
If you don’ have folder /var/log/mysql/, create it
1 2 | mkdir /var/log/mysql/ chown mysql:mysql /var/log/mysql/ |
Now restart MySQL
1 | service mysql restart |
or
1 | service mariadb restart |