MySQL Server provides several logs that help us find out what activity is taking place.
MySQL provides different types of log files.
Error Log: contains information indicating when mysqld was started and stopped and also any critical errors that occur while the server is running.
General Query Log: is a general record of what mysqld is doing. The server writes information to this log when clients connect or disconnect, and it logs each SQL statement received from clients.
Binary Log: contains “events” that describe database changes such as table creation operations or changes to table data.
Relay Log: consists of the events read from the binary log of the master and written by the slave I/O thread. Slow Query Log: consists of SQL statements that took more than long_query_time seconds to execute.
MySQL server log management can be divided into 3 major steps:
Setting: To set the MySQL variables, use the SET keyword or make change in my.ini (mysql configuration) file.
Restart: To reflect the changes, mysql services need to be restarted and enjoying logging on servers using MySQL.
Error Log: contains information indicating when mysqld was started and stopped and also any critical errors that occur while the server is running.
General Query Log: is a general record of what mysqld is doing. The server writes information to this log when clients connect or disconnect, and it logs each SQL statement received from clients.
Binary Log: contains “events” that describe database changes such as table creation operations or changes to table data.
Relay Log: consists of the events read from the binary log of the master and written by the slave I/O thread. Slow Query Log: consists of SQL statements that took more than long_query_time seconds to execute.
MySQL server log management can be divided into 3 major steps:
- Checking
- Setting
- Restart
mysql> show variables like '%log%';
Setting: To set the MySQL variables, use the SET keyword or make change in my.ini (mysql configuration) file.
mysql> SET GLOBAL log = 'ON';
Restart: To reflect the changes, mysql services need to be restarted and enjoying logging on servers using MySQL.
shell$ service mysqld restart
No comments:
Post a Comment