How can I start and check my MySQL log?

前端 未结 5 1337
逝去的感伤
逝去的感伤 2020-12-13 09:45

I want to check the log in MySQL to see the queries that are being run by my application. How can I do this? I am using XAMPP and the directory to MySQL is C:\\xampp\\mysql.

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-13 10:33

    Its given on OFFICIAL MYSQL website.

    SET GLOBAL general_log = 'ON';
    

    You can also use custom path:

    [mysqld]
    # Set Slow Query Log
    long_query_time = 1
    slow_query_log = 1
    slow_query_log_file = "C:/slowquery.log"
    
    #Set General Log
    log = "C:/genquery.log"
    

提交回复
热议问题