Enable query logging for all users and use the general log

This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 需要开启全部用户查询日志,并使用general log

| username: kuweilong666

[TiDB Usage Environment] Production Environment
[TiDB Version] 4.0.0
[Reproduction Path] Operations performed that led to the issue
[Encountered Issue: Issue Phenomenon and Impact]
[Resource Configuration]
[Attachments: Screenshots/Logs/Monitoring]

Enable general log and use a query similar to MySQL:

SELECT *, CONVERT(argument USING utf8mb4) AS content FROM mysql.general_log ORDER BY event_time DESC LIMIT 10;
| username: Kongdom | Original post link

:thinking: Is there any problem?

| username: kuweilong666 | Original post link

How to enable the general log and how to use the general log feature similar to MySQL?

| username: Kongdom | Original post link

Modify system parameters

| username: 啦啦啦啦啦 | Original post link

It should only be written to the TiDB log file and only for the current TiDB server. If needed, the parameters for each TiDB node should be enabled.

| username: 海石花47 | Original post link

Why can’t this feature be automatically aggregated… It’s really frustrating that each TiDB is different, just like show full processlist.

| username: Kongdom | Original post link

There is a table to check the SQL currently being executed by the entire cluster, CLUSTER_PROCESSLIST.

| username: 海石花47 | Original post link

I checked the old version and it doesn’t have it, but v6 does~ Great, thank you~

| username: Kongdom | Original post link

:handshake: :handshake: :handshake:

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.