@jaceklubzinski opened this Issue on March 23rd 2016

We have many archiving processes and don't want to change the global parameters only if one of the archiving needs this.
Generally it is not a good practice to change some variables globally e.g. http://piwik.org/faq/troubleshooting/faq_183/

@tsteur commented on March 29th 2016 Member

Can you explain the issue in more details? I'm not sure which mysql params you mean etc. And how would you like to set and use them?

@quba commented on March 29th 2016 Contributor

E.g. wait_timeout. I presume that @jaceklubzinski wants to be able to set some mysql variables via core:archive param.

@tsteur commented on March 29th 2016 Member

Similar to php-cli-options and we would do something like $this->_connection->query("SET foobarparam = $foobarvalue"); whenever we create database connection?

@jaceklubzinski commented on March 30th 2016

Exactly what we want. Set database dynamic parameter like wait_timeout and max_allowed_packet as session parameter each time we create new database connection.

@otheus commented on June 6th 2022

What happened here? To quote myself in an email I sent the dev team a while back:

We need to fix Matomo1 so that it sets the wait_timeout per connection. Setting the server variable is an ugly ugly hack that does not 'play well with others'. Moving from mysqli to pdo/mysql makes it even worse, since old mysqi at least allowed auto-reconnection. (Forums tell me, however, this feature has been deprecated). Further, the pdo-mysql driver does not allow (or is not documented to allow) config/connection parameters to be set via the DSN. Perhaps it is allowed, but it is not documented. The solution can be found here: https://stackoverflow.com/a/21403360/3849157 . The wait_timeout setting should either be as given above (28800) or better yet, configurable in config.ini.
@justinvelluppillai commented on June 7th 2022 Contributor

Hi @otheus this issue is in our backlog and we would welcome a contribution if you are able to provide a Pull Request for this. It is not currently in a milestone and it hasn't been scheduled yet.

Powered by GitHub Issue Mirror