In MySQL, you can control logging behavior through the configuration settings in the MySQL configuration file (usually my.cnf or my.ini). To disable or enable logs, follow the steps below:
To disable logging, you need to comment out or remove the log directives in the MySQL configuration file. The common log types include general log, slow query log, and binary log.
[mysqld]
# general_log = 1
[mysqld]
# slow_query_log = 1
[mysqld]
# log_bin = mysql-bin
To enable logging, ensure that the related log directives in the MySQL configuration file are not commented out. You can set them to 1 to enable logging.
[mysqld]
general_log = 1
[mysqld]
slow_query_log = 1
[mysqld]
log_bin = mysql-bin
After making changes to the configuration file, always restart the MySQL server for the changes to take effect.
How do I avoid rehashing overhead with std::set in multithreaded code?
How do I find elements with custom comparators with std::set for embedded targets?
How do I erase elements while iterating with std::set for embedded targets?
How do I provide stable iteration order with std::unordered_map for large datasets?
How do I reserve capacity ahead of time with std::unordered_map for large datasets?
How do I erase elements while iterating with std::unordered_map in multithreaded code?
How do I provide stable iteration order with std::map for embedded targets?
How do I provide stable iteration order with std::map in multithreaded code?
How do I avoid rehashing overhead with std::map in performance-sensitive code?
How do I merge two containers efficiently with std::map for embedded targets?