• How to Monitor SQL queries

    by  • October 2, 2014 • Blog • 2 Comments

    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

    2 Responses to How to Monitor SQL queries

    1. Janny
      October 4, 2014 at 11:09 am

      It ‘s really simple instruction. It help me a lot to debug transaction query. Thank author.

      • November 28, 2014 at 10:54 am

        You are welcome, I will release more useful article soon about mysql server.

    Leave a Reply

    Your email address will not be published. Required fields are marked *