Rechercher dans le manuel MySQL
5.4.2.9 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
,
to rename the file and create a new one, use the following
commands:
host_name
.err
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.
Document created the 26/06/2006, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/mysql-rf-error-log-rotation.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.