For Windows, MySQL configuration file is my.ini
, which is located at C:\xampp\mysql\
For Linux, the configuration file is /etc/mysql/my.cnf
, which will include other configuration files, such as /etc/mysql/mysql.conf.d/mysqld.cnf
on Ubuntu.
Add/Un-comment below lines to enable MySQL general log and slow log. Notice that these logging will impact MySQL performance very much, suggest to disable them in normal case.
explicit_defaults_for_timestamp
general-log=1
general-log_file=/var/log/mysql/mysql.log
slow_query_log=1
slow_query_log_file=/var/log/mysql/mysql_slow.log
long_query_time=1
log_queries_not_using_indexes =1