Tuesday, July 30, 2024

.::: How to enable the MySQL/MariaDB general query logs :::.


1. enable general log temporary

SET GLOBAL general_log_file='/var/lib/mysql/general.log';
SET GLOBAL log_output = 'FILE,TABLE';
SET GLOBAL general_log = 'ON';
SET GLOBAL general_log = 1;

 
2. enable general log permanent and restart mariadb
[root@teguhth ~]# cat  /etc/my.cnf.d/server.cnf

userstat = 1
general_log = 1
general_log_file = /var/lib/mysql/general.log
log_output=FILE,TABLE

[root@teguhth ~]#


3. check config


SHOW VARIABLES LIKE "general_log%";
 


4. check general log in table
 

5. check general log in log

 

No comments:

Post a Comment

Popular Posts