Manual:$wgDebugDumpSql

Details
If enabled, all SQL statements are logged to the  channel and the Debugging toolbar (if also enabled). By default, the  channel log messages go to debug log destination as specified by  .

If   is true, the Sql queries are dumped to the html output.