• How to Monitor SQL queries

    by  • October 2, 2014 • Blog

    In PHP web development what relate to database, I usually want to check my SQL detail. But not all of time, I can debug line by line or print out the SQL query to check. Instead of showing SQL queries, I will make it show everything in mysql log file with detail of SQL to check. Here is the easiest way to monitor SQL queries in Linux (you can do the same in Windows or Mac).

    Visit the mysql configuration file:

    Find and uncomment this line

    Now restart mysql server

    Now we’re ready to start monitoring the queries as they come in. Open up a new terminal and run this command to scroll the log file, adjusting the path if necessary.

    sql log