Insights V3 to MySQL MAX_STATEMENT_TIME

Hi, for a while now Insights get an error when it try to connect to a mySQL database. I got the error:
1193, “Unknown system variable ‘MAX_STATEMENT_TIME’”

Any workaround for that. It’s look like new version of MariaDB stop using “max_execution_time”

Thank you


Hi @ginovo,

Thanks for reporting this!

The error you’re seeing:

1193: Unknown system variable ‘MAX_STATEMENT_TIME’

usually occurs when connecting to MariaDB 10.1.1+, where MAX_STATEMENT_TIME has been deprecated and replaced by max_execution_time.

:white_check_mark: Workaround Options:

  1. Use a MySQL-Compatible Version
    If you’re using MariaDB, try switching to a MySQL-compatible version (like MySQL 5.7 or 8.0) that still supports MAX_STATEMENT_TIME.

  2. Upgrade Insights (if a newer patch is available)
    Check if there’s a more recent version of Insights V3 that has removed or replaced the use of MAX_STATEMENT_TIME.

  3. Patch it manually (for dev setups)
    If you have access to the Insights connector code, look for references to MAX_STATEMENT_TIME and replace them with:

    SET SESSION max_execution_time = <timeout_in_ms>;
    
  4. MariaDB Config (optional)
    If you’re locked into using MariaDB, unfortunately, MAX_STATEMENT_TIME isn’t available anymore, and some tools still referencing it will break unless updated.


Let me know which setup you’re using (MariaDB version and Insights version), and I can help guide you further on patching or configuration.

Hope this helps!

Hi Rahul, thank you for the info.

Actualy my ERPNext use mariadb Ver 15.1 Distrib 10.11.11-MariaDB, and the DB I try to connect in Insights use mysql Ver 8.0.42-0

I’m in developer mode. I will try your fix.

I’ll keep you update