1 year ago

Setting wait_timeout for MySQL connection

Posted 1 year ago by pilat

Hi, I need to set wait_timeout session variable for the database connection. BUt:

  1. It has to be done inside my application because the hosting team refuses to change this option "for all of the users". They say I can do it easily by issuing the following query: SET SESSION wait_timeout = XXXXXX.

  2. I need to find a proper place in which to issue this query. As I understand, it should be issued somewhere near connection establishing, is it right? There is no such option in config/database.php and I shouldn't touch files inside vendor/, off cause. Besides, this adjustment should be indexed by git.

So, could you advise a proper way to inject this?

Please sign in or create an account to participate in this conversation.