MySQL parameter max_execution_time

I’m getting errors when trying to connect to mysql:

Error processing query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_statement_time=1200 FOR -- Metabase

I was looking at mysql documentation and found out that there’s no max_statement_time. The parameter has changed to max_execution_time (at least in mysq 26.7.0-cloud).

So, unless the system sends the correct parameter name, I won’t be able to get anything from my database.

My Metabase version is the latest runing on docker: v0.63.2

This problem is being tracked under this GitHub issue:

1 Like

Hi.

They closed the github issue as resolved, saying that was fixed on master. I’m on 0.63.15.1 and the problem persists.

ERROR middleware.catch-exceptions :: Error processing query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_statement_time=1200 FOR -- Metabase:: userID: 1 queryType: native queryHash:' at line 1

Am I doing something wrong? Or did I understand it wrong? It’s been almost a month since the problem started to happen.

Thanx

I’m not sure it’s hit a release yet. There’s no milestone on the PR when it usually gets one when the fix is slotted for a release. The problem happened before the recent security event and may be stuck in the backlog.

There’s also an open issue on upgrading the embedded Java client that may resolve other issues with MySQL 26 on cloud. It might be stuck on that, too.

1 Like

Ok. Thanx for your answer!

Best regards

Do you have any release date estimate? has been more than a moth with this issue

The client update was released in these versions: v58.32, v59.31, v60.27, v61.21, v62.19, v63.16. Try updating to one of those versions. There’s a related PR regarding the timeout setting that is still open, though.

It’s supposed to be fixed but i’m using 0.63.16.7 and still fails

image

"status": "failed",
  "exception": "class clojure.lang.ExceptionInfo",
  "message": "Error al ejecutar la consulta: (conn=681691) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_statement_time=1200 FOR SELECT NULL AS `pk-table-schema`, `a`.`...",
  "stacktrace": [
    "--> driver.sql_jdbc.execute$reducible_query$reify__112315$fn__112316$fn__112317.invoke(execute.clj:950)",
    "driver.sql_jdbc.execute$reducible_query$reify__112315$fn__112316.invoke(execute.clj:946)",
    "driver.sql_jdbc.execute$fn__111996$fn__111997.invoke(execute.clj:473)",
    "driver.sql_jdbc.execute$do_with_resolved_connection.invokeStatic(execute.clj:389)",
    "driver.sql_jdbc.execute$do_with_resolved_connection.invoke(execute.clj:352)",
    "driver.sql_jdbc.execute$fn__111996.invokeStatic(execute.clj:467)",
    "driver.sql_jdbc.execute$fn__111996.invoke(execute.clj:465)",
    "driver.sql_jdbc.execute$reducible_query$reify__112315.reduce(execute.clj:940)",
    "sync.fetch_metadata$fk_metadata$fn__106841.invoke(fetch_metadata.clj:158)",
    "workspaces.table_remapping$fn__106552$call_with_fk_probe_iso_dbs__106553.invoke(table_remapping.clj:99)",
    "premium_features.defenterprise$dynamic_ee_oss_fn$fn__52020.doInvoke(defenterprise.clj:60)",
    "sync.fetch_metadata$fk_metadata.invokeStatic(fetch_metadata.clj:155)",
    "sync.fetch_metadata$fk_metadata.doInvoke(fetch_metadata.clj:134)",
    "sync.sync_metadata.fks$sync_fks_BANG_$fn__108970.invoke(fks.clj:131)",
    "sync.util$do_with_error_handling.invokeStatic(util.clj:240)",
    "sync.util$do_with_error_handling.invoke(util.clj:233)",
    "sync.sync_metadata.fks$sync_fks_BANG_.invokeStatic(fks.clj:127)",
    "sync.sync_metadata.fks$sync_fks_BANG_.invoke(fks.clj:120)",
    "sync.util$run_step_with_metadata$fn__74649$fn__74650$fn__74653.invoke(util.clj:644)",
    "task_history.models.task_history$do_with_task_history.invokeStatic(task_history.clj:238)",
    "task_history.models.task_history$do_with_task_history.invoke(task_history.clj:221)",
    "sync.util$run_step_with_metadata$fn__74649$fn__74650.invoke(util.clj:637)",
    "sync.util$do_with_returning_throwable.invokeStatic(util.clj:261)",
    "sync.util$do_with_returning_throwable.invoke(util.clj:258)",
    "sync.util$run_step_with_metadata$fn__74649.doInvoke(util.clj:636)",
    "sync.util$with_start_and_finish_logging_STAR_.invokeStatic(util.clj:162)",
    "sync.util$with_start_and_finish_logging_STAR_.invoke(util.clj:156)",
    "sync.util$do_with_start_and_finish_debug_logging.invokeStatic(util.clj:181)",
    "sync.util$do_with_start_and_finish_debug_logging.invoke(util.clj:177)",
    "sync.util$run_step_with_metadata.invokeStatic(util.clj:631)",
    "sync.util$run_step_with_metadata.invoke(util.clj:625)",
    "sync.util$run_sync_operation$fn__74698$fn__74706.invoke(util.clj:714)",
    "sync.util$run_sync_operation$fn__74698.invoke(util.clj:712)",
    "task_history.models.task_history$do_with_task_history.invokeStatic(task_history.clj:238)",
    "task_history.models.task_history$do_with_task_history.invoke(task_history.clj:221)",
    "sync.util$run_sync_operation.invokeStatic(util.clj:709)",
    "sync.util$run_sync_operation.invoke(util.clj:704)",
    "sync.sync_metadata$sync_db_metadata_BANG__STAR_.invokeStatic(sync_metadata.clj:77)",
    "sync.sync_metadata$sync_db_metadata_BANG__STAR_.invoke(sync_metadata.clj:62)",
    "sync.sync_metadata$sync_db_metadata_explicit_BANG_$fn__109277.invoke(sync_metadata.clj:105)",
    "sync.util$do_with_error_handling.invokeStatic(util.clj:240)",
    "sync.util$do_with_error_handling.invoke(util.clj:233)",
    "driver$fn__62177.invokeStatic(driver.clj:1223)",
    "driver$fn__62177.invoke(driver.clj:1223)",
    "sync.util$sync_in_context$fn__74503.invoke(util.clj:198)",
    "sync.util$with_db_logging_disabled$fn__74500.invoke(util.clj:190)",
    "sync.util$with_start_and_finish_logging_STAR_.invokeStatic(util.clj:162)",
    "sync.util$with_start_and_finish_logging_STAR_.invoke(util.clj:156)",
    "sync.util$with_start_and_finish_logging$fn__74477.invoke(util.clj:175)",
    "sync.util$with_sync_events$fn__74472.invoke(util.clj:148)"
  ],
  "ex-data": {
    "driver": "mysql",
    "sql": [
      "SELECT",
      "  NULL AS `pk-table-schema`,",
      "  `a`.`referenced_table_name` AS `pk-table-name`,",
      "  `a`.`referenced_column_name` AS `pk-column-name`,",
      "  NULL AS `fk-table-schema`,",
      "  `a`.`table_name` AS `fk-table-name`,",
      "  `a`.`column_name` AS `fk-column-name`",
      "FROM",
      "  `information_schema`.`key_column_usage` AS `a`",
      "  INNER JOIN `information_schema`.`table_constraints` AS `b` USING (",
      "    `constraint_schema`,",
      "    `constraint_name`,",
      "    `table_name`",
      "  )",
      "WHERE",
      "  (`b`.`constraint_type` = 'FOREIGN KEY')",
      "  AND (`a`.`referenced_table_schema` IS NOT NULL)",
      "ORDER BY",
      "  `a`.`table_name` ASC"
    ],
    "params": null
  },
  "original-info": null
}

2026-09-08T15:36:43-03:00 error metabase.sync.fetch-metadata Error while fetching metadata with 'fk-metadata': Error al ejecutar la consulta: (conn=681691) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_statement_time=1200 FOR SELECT NULL AS `pk-table-schema`, `a`.`referenced_ta' at line 1

You’re welcome. I’d keep an eye on the release notes for the next few Metabase versions, since fixes merged to master don’t always land in the immediately available Docker tag.

If this is blocking you, it may be worth adding a comment on the GitHub issue with your exact Metabase version and MySQL cloud version, just so the maintainers know it still affects 0.63.15.1.