How to read innodb log file?

I would like to see the โ€œgeneral query logโ€ from the innodb log file, so does anyone know how to view / read these query logs?

I tried the MySQL admin utility, it shows that the error log and query log are disabled.

+6
source share
2 answers

Answer: you cannot .

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

[Space-id] [Page-id] [Where-in-page for modification] [Payload]

  • Space-id - file number (for example, ibdata1 = file number 0).
  • The id page is the page in this file. All pages are 16K.
+6
source

Log queries are a big performance overload, so itโ€™s disabled by default. If you want to log requests, set the value of the log variable to my.cnf

log=/tmp/mysql.log 

It is not recommended if your application is running live, as it will greatly slow down, and users may receive 500 or connection timeout errors. After debugging is complete, comment on it.

0
source

Source: https://habr.com/ru/post/886057/


All Articles