如何关闭MySQL日志?25字提示您操作细节!(关闭mysql日志)
  iDU31ygkXmx7 2023年11月19日 12 0

How to Disable MySQL Logging?

MySQL is a powerful and open source relational database management system (RDMS). As with any software application, MySQL also has a logging system that can be used to track actions taken by users. If too much logging is enabled, MySQL can become slow and the logs can impact database performance. That is why it is important to learn how to disable MySQL logging. Here are the steps to turn off the logging feature:

Step 1: Connect to your database server using the MySQL Command Line Interface (CLI).

Step 2: Execute the following command to stop the general query log:

SET GLOBAL general_log = ‘OFF’;

Step 3: Check the current log file path with the following command:

show variables like ‘general_log_file’;

Step 4: Execute the following command to stop the slow query log:

SET GLOBAL slow_query_log = ‘OFF’;

Step 5: Again, check the current log file path with the following command:

SHOW VARIABLES LIKE ‘slow_query_log_file’;

Step 6: To disable binary logs, execute the following command:

SET GLOBAL binlog_format = ‘OFF’;

Step 7: Check the current binary log file path with the following command:

SHOW VARIABLES LIKE ‘log_bin’;

Now that you know how to disable the logging feature of MySQL, you can find out which log files are causing the database to slow down and take measures to prevent it in the future. With all logging turned off, your database can run more efficiently and with less resources.

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月19日 0

暂无评论

推荐阅读
iDU31ygkXmx7