要配置MySQL的监控和日志记录,可以按照以下步骤操作:
performance_schema = ON
sudo systemctl restart mysql
log_error = /var/log/mysql/error.log
general_log = 1
general_log_file = /var/log/mysql/general.log
sudo systemctl restart mysql
tail -f /var/log/mysql/error.log
tail -f /var/log/mysql/general.log
通过以上步骤配置监控和日志记录,您可以更好地监视MySQL的性能和故障排查。