Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Handouts for operating mysql general log

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The following content mainly brings you the relevant handouts on the operation of mysql general log. The knowledge mentioned here, which is slightly different from books, is summarized by professional and technical personnel in the process of contact with users, and has a certain value of experience sharing. I hope to bring help to the majority of readers.

When mysql opens general log, all queries will be recorded in the general log file, which is read-only, but the general log file will be very large, so it is turned off by default.

But sometimes need to check errors and other reasons, temporarily need to open general log.

Open method:

Show global variables like'% general%';set global general_log = on; / / Open set global general_log = off; / / close

General log is recorded to a text file by default, but changes can be recorded to the database by modifying log_output='TABLE', and a table general_log is added to mysql db.

By looking at the table structure, it is an external csv file.

Show global variables like'% log_output%';set global log_output = 'TABLE';use mysql;show create table general_log\ G

Because the general_log table is an external csv file, the performance of querying this table is low, and the engine of the table should be changed to myisam to improve performance.

Set global general_log = off;alter table general_log engine = myisam;set global general_log = on

These are the details about the operation of mysql general log, please pay attention to other related articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report