Mysql-log-Basic Knowledge
1. log types:
MySQL has the following types of logs:
Error Log:-log-err
Query log:-Log
Slow query log:-log-Slow-queries
Update log:-log-Update
Binary log:-log-bin
2. Whether logs are enabled
Mysql> show variables like 'Log _ % ';
3. How to know the current log
Mysql> show Master status;
Four display the number of binary logs
Mysql> show Master logs;
5. Use mysqlbinlog to view binary log files
Shell> mysqlbinlog mail-bin.000001
Or
Shell> mysqlbinlog mail-bin.000001 | tail
Mysqlbinlog-ucopy-P "D: \ Program Files \ mysql \ MySQL Server 5.1 \ data \ center-bin.000056"
6. safely delete MySQL binary logs
Mysql> show Master logs;
This command displays the current number of binary logs.
Then
Mysql> purge master logs to 'binary-log. XXX ';
Except for the logs given in the command, all other binary logs are deleted.
The details are as follows:
Purge master logs
Purge {master | binary} logs to 'Log _ name'
Purge {master | binary} logs before 'date'
7. Refresh logs
Mysql> flush logs;
Clear binary logs
Mysql> Reset master;