Welcome Guest, Not a member yet? Register   Sign In
How to see MySQL activities on profiler from all active MySQL connections?

Hi Everyone,

On my CI powered website, the profiler is enabled and I can see MySQL activity from the main database set in database.php

But I can not see other MySQL activities happening on other MySQL connections opened dynamically during the code run $config and load->database($config, true) routines.

Any suggestions about how to see all MySQL activities from all MySQL connections on profiler?


If you create a second connection and store it in a local variable, the profiler won't be able to pick it up.

$CI =& get_instance();
$CI->db2 = $this->load->database($config, TRUE);
// make it known to our controller
$this->db2 =& $CI->db2;

instead of:
$db2 = $this->load->database($config, TRUE);

Great, thanks! It works like a charm!


Theme © iAndrew 2016 - Forum software by © MyBB