Posts

Showing posts from June, 2019

MySQL 8.0 : Error Logging

Image
MySQL 8.0 : Error Logging
Here I would like to explain, How MySQL 8.0 server can be configured to log diagnosis messages inside the error log file. 
Generally, the error log contains: A record for mysqld service startup and shutdown.Diagnostic messages such as errors, warnings, and notes during mysqld server startup, running or shut down. A stack trace if mysqld exits abnormally. mysqld_safe writes once it finds mysqld exists abnormally and mysqld_safe invoke/start mysqld.  Error Log Component Configuration MySQL 8.0 uses the MySQL error log component architecture that performs log event filtering and writing. These error log components can be configured using the system variable to achieve the desired logging results inside the error log file.

We have mainly two types of error log components: filter & sink.

Error Log Filter Components --->  Filter components, mainly process log events, to add, delete or modify event fields or to delete events entirely. Error Log Sink Components

How to properly shutdown MySQL before any maintenance activity

Image
How to properly shutdown MySQL before any maintenance activity
We might have different scenarios once we need to stop MySQL service before performing either server or database activity like patching/upgrade.  
Before performing such activity, we need to make sure that we stop MySQL service properly to avoid any unforeseen crashes once our maintenance activity complete and MySQL service is started. 
Here I would like to share the below steps which should be performed and take care to properly stop MySQL service. 
Step 1: Ensure we don't have any long-running queries. Manually verify by checking the processlist. show processlist;  Step 2: If it is the master node, then ensure to stop application write hits on the database by doing either stop an app and put in maintenance OR if we have any failover solution then move write hits on another node. 
Step 3: If it is a slave node, then STOP replication and note down the stopped replication co-ordinates.  stop slave; show slave status\G…