How do I print all the queries in Magento?

后端 未结 6 1881

Is it possible to display all the query strings in Magento? I really like to see what queries are executed.

Thanks

6条回答
  •  春和景丽
    2020-12-07 15:31

    Turn on the MySQL logging will sure log all queries transactions. Here is how you can turn on the logging on.To turn on the logging to log to a file. Place the following in the my.cnf file or my.ini file if on windows, and restart MySQL.

    log = /path/to/your/logfile.log
    

    Then if you want to log to the table mysql.general_log, run these queries:

    SET GLOBAL log_output = 'TABLE';
    SET GLOBAL general_log = 'ON';
    

    Run these if you want to log to the file:

    SET GLOBAL log_output = "FILE"; 
    SET GLOBAL general_log = 'ON';
    

提交回复
热议问题