Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 37.6Mb
PDF (A4) - 37.5Mb
PDF (RPM) - 33.3Mb
HTML Download (TGZ) - 8.3Mb
HTML Download (Zip) - 8.3Mb
HTML Download (RPM) - 7.2Mb
Man Pages (TGZ) - 129.9Kb
Man Pages (Zip) - 185.5Kb
Info (Gzip) - 3.3Mb
Info (Zip) - 3.3Mb

MySQL 8.0 Reference Manual  /  ...  /  Error Log File Flushing and Renaming

Pre-General Availability Draft: 2018-03-21 Error Log File Flushing and Renaming

If you flush the error log using FLUSH ERROR LOGS, FLUSH LOGS, or mysqladmin flush-logs, the server closes and reopens any error log file to which it is writing. To rename an error log file, do so manually before flushing. Flushing the logs then opens a new file with the original file name. For example, assuming a log file name of host_name.err, to rename the file and create a new one, use the following commands:

mv host_name.err host_name.err-old
mysqladmin flush-logs
mv host_name.err-old backup-directory

On Windows, use rename rather than mv.

If the location of an error log file is not writable by the server, the log-flushing operation fails to create a new log file. For example, on Linux, the server might write the error log to the /var/log/mysqld.log file, where the /var/log directory is owned by root and is not writable by mysqld. For information about handling this case, see Section 5.4.7, “Server Log Maintenance”.

If the server is not writing to a named error log file, no error log file renaming occurs when the error log is flushed.

User Comments
Sign Up Login You must be logged in to post a comment.