Skip to main content
Refreshes all active connections to apply global variables that have been changed by SET GLOBAL. This command allows administrators to update long-lived connections (such as those from connection pools) when runtime parameters are adjusted, without requiring connections to reconnect.

Background

By default, SET GLOBAL in the database only affects newly created connections. Existing sessions keep their local copies of session variables until they disconnect or explicitly run SET SESSION. This behavior is consistent with MySQL but makes it difficult to update long-lived connections when administrators adjust runtime parameters. The REFRESH CONNECTIONS command solves this problem by allowing administrators to refresh all active connections to apply the latest global variable values. Tip This command requires the OPERATE privilege on the SYSTEM object.

Syntax

Parameters

Behavior

  • Selective refresh: By default, the command only refreshes variables that have not been modified by the session itself. Variables that were explicitly set using SET SESSION are preserved. When FORCE is specified, all variables are refreshed regardless of session modifications.
  • Immediate execution: Running statements are not affected immediately. The refresh takes effect before the next command is executed.
  • Distribution: The command is automatically distributed to all FE nodes via RPC, ensuring consistency across the cluster.
  • Privilege requirement: Only users with OPERATE privilege on the SYSTEM object can execute this command.

Examples

Example 1: Refresh all connections after changing a global variable.
After executing REFRESH CONNECTIONS, all active connections (except those that have modified query_timeout in their session) will have their query_timeout value updated to 600. Example 2: Refresh connections after changing multiple global variables.
Example 3: Force refresh all connections, including those with session-modified variables.
After executing REFRESH CONNECTIONS FORCE, all active connections will have their query_timeout value updated to 600, even if they previously modified this variable using SET SESSION query_timeout = 500.

Notes

  • By default, variables that have been modified in a session using SET SESSION are not refreshed. For example, if a connection has executed SET SESSION query_timeout = 500, the query_timeout value for that connection will remain 500 even after REFRESH CONNECTIONS is executed. However, if you use REFRESH CONNECTIONS FORCE, all variables will be refreshed regardless of session modifications.
  • When FORCE is specified, variables that were previously modified by the session are reset to the global default values, and their modification flags are cleared. This allows future non-forced refreshes to update these variables.
  • The command affects all active connections on all FE nodes in the cluster.
  • Session-only variables (variables that cannot be set globally) are not affected by this command.
  • Variables with the DISABLE_FORWARD_TO_LEADER flag are not refreshed.
  • SET: Set system variables or user-defined variables
  • SHOW VARIABLES: Show system variables