Checking and enabling slow query log in MySQL

Problem

You would like to check and enable the slow query log for MySQL.

Solution

To check if the log is on run the following query

show global variables like '%slow_queries'

To switch it on if the above shows it as OFF, use the following:

set @@GLOBAL.log_slow_queries = 'ON'