I want active log file in mariadb for check last query used in php, i find mysql config in internet like as blow:
general_log_file = /var/log/mysql/mysql.log
general_log = 1
or
log = /var/log/mysql/mysql.log
I added this config in /etc/mysql/my.cnf
and [mysql]
section and restart mariadb service.
but i didn't get any log, how to fix this?
i find answer:
[mysqld]
...
log_output = FILE
general_log = ON
general_log_file = mysql.log
mysql.log save in datadir, run SHOW VARIABLES WHERE variable_name = 'datadir'
in mariadb to get datadir.
SET global general_log = 1
to activate logging 'on the fly' Whether or not you should do this depends on your circumstances of course...