How can I start and check my MySQL log?

前端 未结 5 1347
逝去的感伤
逝去的感伤 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:30

    Enable general query log by the following query in mysql command line

    SET GLOBAL general_log = 'ON';
    

    Now open C:/xampp/mysql/data/mysql.log and check query log

    If it fails, open your my.cnf file. For windows its my.ini file and enable it there. Just make sure its in the [mysqld] section

    [mysqld]
    general_log             = 1
    

    Note: In xampp my.ini file can be either found in xampp\mysql or in c:\windows directory

提交回复
热议问题