MySQL provides a complete set of logging configuration items, but many of them are disabled by default. I wonder why MySQL does not have query listening like SQLServer. After searching
MySQL provides a complete set of logging configuration items, but many of them are disabled by default. I wonder why MySQL does not have query listening like SQL Server. After searching
MySQL provides a complete set of logging configuration items, but many of them are disabled by default. I wonder why MySQL does not have query listening like SQL Server. After searching for information, it is found that MySQL can also implement the SQL statement for record query.
The method is to modify the my. cnf configuration file (my. ini for windows)
Add the following configuration items under the [mysqld] node.
General-log = 1
Log =/usr/local/mysql/general-log.log
-----------------------------------
Of course, this configuration is suitable for programmers to debug program performance. It is not recommended to enable it in the production environment.
Appendix: Slow query log. For configuration reference:
Slow_query_log = 1
Long_query_time = 2
Slow_query_log_file =/usr/local/mysql/mysql-slow.log.