I am struggling to find where to set the command timeout in Yii for MySql database (some queries are taking a while to run).
In the source code the file protected/config/main.php has these settings:
'db'=>array( 'connectionString' => 'mysql:host=xxx;dbname=xxx;port=xxx;timeout=100;', 'emulatePrepare' => true, 'username' => 'xxx', 'password' => 'xxx', 'charset' => 'utf8', 'schemaCachingDuration'=>3600, ),
The timeout seems to apply to connections, and command timeout default is 30 seconds (that's the one I need to increase).
Web pages fetching from db usually fail with Fatal error: Maximum execution time of 30 seconds exceeded in \YiiRoot\framework\db\CDbCommand.php on line 508.
line 508 is
$this->_statement->execute();
so obviously is a query timeout.