0

When running queries in MySQL workbench, some of them are captured to the log file at either:

  • MySQL/Workbench/logs
  • MySQL/Workbench/sql_history

However, I'd like to see ALL the possible queries that MySQL workbench does. Is there a way to do this on the client-side, i.e., where MySQL workbench is running? For example, it would be nice to see how these graphs are being generated and the system data is being grabbed, etc.:

enter image description here

2 Answers 2

1

To see all queries sent to a server check the general/slow query log (it must be activated for that server, of course).

Alternatively, for these graphs check the source code of MySQL Workbench. Use the labels below the graphs to find a location in code. For example the "InnoDB Buffer Usage" graph is created in plugins/wb.admin/Frontend/wb_admin_monitor.py. Study the code to learn which variables are queried to get series of values.

3
  • awesome thank you -- and you wrote it too! One question, from github.com/mysql/mysql-workbench/blob/… -- where it defines the InnoDB Buffer Usage -- which file actually is responsible to building the queries (I would assume it's one in the wb.admin/Backend directory). Thanks for your help.
    – David542
    Nov 7, 2020 at 21:03
  • additionally, with the slow/general query log, which I have enabled and I can view all queries from the server side (but it gets quite polluted because RDS administration runs about 5 queries every second) -- is there a way to log the user/connection_id in the log so I can filter by that? (basically whatever would be given in SHOW FULL PROCESSLIST)
    – David542
    Nov 7, 2020 at 21:05
  • The queries are very simple. The magic is mostly which variables to read. WB runs a show global status and examines the rows that are returned. Filtering the logs is not possible in WB. Maybe another external tool can help here. Nov 8, 2020 at 9:45
0

To capture all queires you have to enable generll log in the my.ini/cnf file, the you wil find under the [mysqld] section

[mysqld]
log-output=FILE
general-log=1
general_log_file="C:/ProgramData/MySQL/MySQL Server 8.0/Data/general_log.log"

But be cqarefull that gets realy fast, very full and should only be enabled for debuggi9ng reasons for a short period of time.

For the folder of the file it is necessary to have read/write permisssions in it, but when you use the data directory you should have it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.