MySQL 8.0 Database Administrator — Question 90
Which step or set of steps can be used to rotate the error log?
Answer options
- A. Execute SET GLOBAL log_error = ‘<new error log file>’.
- B. Execute SET GLOBAL max_error_count = <number of messages at point to rotate>.
- C. Execute SET GLOBAL expire_logs_days=0 to enforce a log rotation.
- D. Rename the error log file on disk, and then execute FLUSH ERROR LOGS.
Correct answer: D
Explanation
The correct answer is D because renaming the error log file on disk followed by executing FLUSH ERROR LOGS prompts the server to start writing to a new error log. Options A, B, and C do not actually perform the log rotation; they only modify settings or configurations related to error logging.