Knowledgebase

Understanding Database Logs Print

  • 0

What the server records.

WHAT LOGS EXIST

The error log The slow query log The general query log The binary log

WHAT THE ERROR LOG CONTAINS

Startup and shutdown Crashes and recovery Warnings and errors

WHY IT IS THE FIRST PLACE TO LOOK

It explains failures to start, and crashes.

WHAT THE SLOW QUERY LOG CONTAINS

Queries exceeding a threshold.

WHAT TO SET THE THRESHOLD TO

Low enough to be useful, and watch its size.

WHAT ELSE TO ENABLE

Logging of queries not using indexes, temporarily.

WHY TEMPORARILY

It is voluminous on a busy server.

WHAT THE GENERAL LOG CONTAINS

Every statement.

WHEN TO USE IT

Briefly, to see exactly what an application sends.

WHY BRIEFLY

It is enormous and costs performance.

WHAT THE BINARY LOG CONTAINS

Every change, for replication and point-in-time recovery.

WHAT TO CONFIGURE

Retention long enough to cover your backups.

WHY THAT MATTERS

Recovery needs logs reaching back to the backup.

WHAT TO MONITOR

Log disk usage.

WHAT COMMONLY FILLS A DISK

Binary logs never expired.

WHAT TO NEVER DO

Delete binary logs by hand while replicas depend on them.

WHAT TO USE INSTEAD

The purge command, which respects that.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot