Skip to content

Commit ddb1fe9

Browse files
committed
- add mistakes section
- improve error log text
1 parent d5d319f commit ddb1fe9

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

studies/mysql.md

+23-12
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,25 @@ According to [mysql's docs][mysql-docs], there are about five different kinds of
2121
Depending on storage engines used, you'll have other log files as well (innodb
2222
log file, etc).
2323

24+
In most mysql deployments, there are 3 possible actors: the mysql server, mysql
25+
clients, and replication parters. The logs tend to cover actions between pairs
26+
of actors, or roughly the purpose of each log:
27+
28+
* internal mysql server: error log
29+
* replication: binary and relay logs
30+
* clients: general query and slow query logs
31+
2432
## Error Log
2533

2634
Relevant my.cnf settings: `log-error`, `log-warnings`.
2735

28-
The error log generally contains information about mysqld's status; generally
29-
start and stop messages as well as critical errors. Unfortunately, mysql also
30-
logs warnings to the error log by default.
36+
According to mysql's docs, the error log generally contains information about
37+
mysqld's status; generally start and stop messages as well as critical errors.
38+
Unfortunately, mysql also logs warnings to the error log by default.
39+
40+
What the docs don't say is that pretty much anything not data-related is logged
41+
here. This log file is a complete mess. Most of what I see in the sample below
42+
has nothing to do with errors or warnings.
3143

3244
120707 0:37:09 [Note] Plugin 'FEDERATED' is disabled.
3345
120707 0:37:09 InnoDB: The InnoDB memory heap is disabled
@@ -51,6 +63,14 @@ The format of this log file is a bit confusing and pretty inconsistent. I'm not
5163
sure how "highest supported file format is Barracuda." is an error or a
5264
warning, but it's in the error log anyway. ☹
5365

66+
### Mistakes
67+
68+
This log format is a bit strange. The timestamp seems consistent, even if it is
69+
odd. The message seems to have no consistency, meaning 'grep' and other
70+
pattern/text tools may be your chief weapons against this beast.
71+
72+
I wouldn't expect to achieve much in the ways of data mining from this log.
73+
5474
## General Query Log
5575

5676
This log appears to contain every request sent to the mysql server. Here's what
@@ -92,12 +112,3 @@ And in the general query log:
92112

93113
## Relay Log
94114

95-
96-
# Overview
97-
98-
We can bucket these logs by purpose:
99-
100-
* application internal: error log
101-
* replication: binary and relay logs
102-
* user: general query and slow query logs
103-

0 commit comments

Comments
 (0)