How can I set the "timeout" when using MySQL?

While using MySQL, how can I setup the max connection time and max execution time?

I’ve tried setting the “timeout” attribute of the “db” component in the config file (main.php) but it failed. It seems that I can only set the “mysqlnd.net_read_timeout” in the php.ini file.

And what if I change my database to PostgreSQL?

Why would you need to do this? If your query is taking that long there is something wrong with it. Can I see it?

Yii provides DB abstraction layer meaning, if you change your DBMS from MySQL to Postgree or MSSQL, your queries will work, AR classes will work, and you should not get any errors.