Documentation Home
MySQL 5.7 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 35.1Mb
PDF (A4) - 35.2Mb
Man Pages (TGZ) - 256.4Kb
Man Pages (Zip) - 361.2Kb
Info (Gzip) - 3.4Mb
Info (Zip) - 3.4Mb
Excerpts from this Manual

MySQL 5.7 Reference Manual  /  ...  /  Error Logging on Unix and Unix-Like Systems

5.4.2.2 Error Logging on Unix and Unix-Like Systems

On Unix and Unix-like systems, mysqld uses the --log-error option to determine whether mysqld writes the error log to the console or a file, and, if to a file, the file name:

  • If --log-error is not given, mysqld writes the error log to the console.

  • If --log-error is given without naming a file, mysqld writes the error log to a file named host_name.err in the data directory.

  • If --log-error is given to name a file, mysqld writes the error log to that file (with an .err suffix added if the name has no suffix). The file ___location is under the data directory unless an absolute path name is given to specify a different ___location.

  • If --log-error is given in an option file in a [mysqld], [server], or [mysqld_safe] section, on systems that use mysqld_safe to start the server, mysqld_safe finds and uses the option, and passes it to mysqld.

Note

It is common for Yum or APT package installations to configure an error log file ___location under /var/log with an option like log-error=/var/log/mysqld.log in a server configuration file. Removing the path name from the option causes the host_name.err file in the data directory to be used.

If the server writes the error log to the console, it sets the log_error system variable to stderr. Otherwise, the server writes the error log to a file and sets log_error to the file name.