-- 临时启用通用查询日志
SET GLOBAL general_log = 'ON';
SET GLOBAL log_output = 'TABLE';
-- 查询连接日志
SELECT * FROM mysql.general_log WHERE command_type = 'Connect';
-- 临时禁用通用查询日志
SET GLOBAL general_log = 'OFF';
-- 临时启用通用查询日志
SET GLOBAL general_log = 'ON';
SET GLOBAL log_output = 'TABLE';
-- 查询连接日志
SELECT * FROM mysql.general_log WHERE command_type = 'Connect';
-- 临时禁用通用查询日志
SET GLOBAL general_log = 'OFF';