John Cure
John Cure

Reputation: 71

How to read innodb log file?

I would like to see "general query log" from innodb log file, so is there anybody know how to see / read those query logs?

I tried MySQL admin utility, it shows only error log and query log is disabled.

Upvotes: 7

Views: 17532

Answers (2)

Morgan Tocker
Morgan Tocker

Reputation: 3438

The answer is that you can not.

The ib_logfile* files do not contain queries, but rather 512-byte aligned instructions on how to re-apply changes made by queries. For example:

[Space-id] [Page-id] [Where-in-the-page-to-modify] [Payload]

  • Space-id is the file number (e.g. ibdata1 = file number zero).
  • Page-id is which page within that file. All pages are 16K.

Upvotes: 7

Ashwini Dhekane
Ashwini Dhekane

Reputation: 2290

Logging queries is a big performance overload, hence it is disabled by default. If you want to log queries then set log variable in my.cnf

log=/tmp/mysql.log

It is not recommended if your application is live as it will slow it down really hard and users might get 500 or connection timeout errors. Once you are done debugging comment it.

Upvotes: -1

Related Questions