Error Log Location?

  • General log - all queries - see VARIABLE general_log
  • Slow log - queries slower than long_query_time - slow_query_log_file
  • Binlog - for replication and backup - log_bin_basename
  • Relay log - also for replication
  • general errors - mysqld.err
  • start/stop - mysql.log (not very interesting) - log_error
  • InnoDB redo log - iblog*

See the variable basedir and 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_error for the error message log;
  • general_log_file for the general query log file (if enabled by general_log);
  • slow_query_log_file for the slow query log file (if enabled by slow_query_log);

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


Yes, MySQL writes a log file.

Its path is /var/log/mysql.log, defined in the log_error config variable.

There is also a logfile for errors /var/log/mysql.err

Tags:

Mysql

Log