Help Center/ Migration Center/ Tool Guide/ Tool Discovery/ Configuring Collector Parameters/ MySQL-General Log Collector (app-discovery-mysql-generallog)
Updated on 2024-12-13 GMT+08:00

MySQL-General Log Collector (app-discovery-mysql-generallog)

This collector collects the host and port information of clients based on the general log of a MySQL database. For details about the configuration parameters, see Table 1.

Table 1 Parameters for configuring the MySQL-General Log collector

Parameter

Mandatory

Configuration

output_path

No

Enter the storage path of the collection result file (app-discovery-mysql-generallog-xxx.csv). If this parameter is left blank, the storage path defaults to <collector-installation-path>\output\file.

Example: C:\Edge\tools\plugins\collectors\app-discovery-collectors\python\mgc-app-discovery-collectors\app-discovery-mysql-generallog\output\file\app-discovery-mysql-generallog-xxx.csv

exclude_ip

No

Enter the IP addresses of the clients whose data does not need to be collected. Use commas (,) to separate multiple IP addresses. Example: 127.0.0.1,192.168.1.1

import

Yes

Enter the path of the general log, for example, C:\data\logs.

To enable MySQL general log, perform the following steps:

  1. Add the following configuration information to [mysqld] in the my.ini file:
    log-output=FILE 
    general_log=1 
    general_log_file="D:\mysqllog\mysql_general.log"

    general_log_file indicates the log file path. In Linux, the example path is /data/log/mysql_general.log.

  2. Run the following command to restart the MySQL service:
    net stop mysql 
    net start mysql