-- show variables
mysql
show variables like '%log%';
-- 1. Set the destination output to FILE
SET GLOBAL log_output = 'FILE';
-- 2. Specify the custom log file path
SET GLOBAL general_log_file = '/var/log/mysql/custom_general.log';
make sure /var/log/mysql/custom_general.log cannot be write by mysql user account
-- 3. Enable the general log
SET GLOBAL general_log = 'ON';