Does MySQL write any log file? If yes, what is the path of it (on ubuntu/Linux)?
- General log - all queries - see VARIABLE
- Slow log - queries slower than
- Binlog - for replication and backup -
- Relay log - also for replication
- general errors -
- start/stop -
mysql.log(not very interesting) -
- InnoDB redo log -
See the variable
datadir for default location for many logs
Some logs are turned on/off by other VARIABLES. Some are either written to a file or to a table.
The MySQL logs are determined by the global variables such as:
log_errorfor the error message log;
general_log_filefor the general query log file (if enabled by
slow_query_log_filefor the slow query log file (if enabled by
To see the settings and the logs' locations, run this shell command:
mysql -se "SHOW VARIABLES" | grep -e log_error -e general_log -e slow_query_log
Thank you to @kenorb at https://stackoverflow.com/a/37685324/470749
Other than the error log on Windows, none of the MySQL logs are enabled. This is to maximize server resources for the database. For that reason, it's advisable to activate them on an as-needed basis.
That can also make it difficult to know which logs are enabled at any given time. For that reason, I like to have all of my config variables in one place so that I can look them up quick. There are a few GUI tools that are good for this. I personally use Navicat for MySQL and Navicat Premium.
Both have a Monitoring tool that contains a tab with all of the server variables in one comprehensive list.