nerdexam
Oracle

1Z0-888 · Question #28

One of your colleagues is trying to make a change using the mysql command-line client for his or her application session: mysql> SET SESSION max_connections = 200; Why does the command fail?

The correct answer is A. max_connections requires the GLOBAL scope. max_connections is a global-only system variable - it governs the total concurrent connections allowed to the entire MySQL server, which is inherently a server-wide concern, not a per-session one. MySQL will throw ERROR 1229: Variable 'max_connections' is a GLOBAL variable and…

Installation and Configuration

Question

One of your colleagues is trying to make a change using the mysql command-line client for his or her application session: mysql> SET SESSION max_connections = 200; Why does the command fail?

Options

  • Amax_connections requires the GLOBAL scope.
  • BIts current user does not have the SUPER privilege.
  • Cmax_connections is not a dynamic variable. You need to change the config file and restart the database.
  • DUsers can control only the max_user_connections variable.

How the community answered

(39 responses)
  • A
    77% (30)
  • B
    8% (3)
  • C
    13% (5)
  • D
    3% (1)

Explanation

max_connections is a global-only system variable - it governs the total concurrent connections allowed to the entire MySQL server, which is inherently a server-wide concern, not a per-session one. MySQL will throw ERROR 1229: Variable 'max_connections' is a GLOBAL variable and should be set with SET GLOBAL, regardless of who runs it. The fix is simply SET GLOBAL max_connections = 200;.

Why the distractors are wrong:

  • B is a red herring - privilege is irrelevant here; the failure happens before MySQL even checks permissions because the scope itself is invalid.
  • C is wrong because max_connections is dynamic (changeable at runtime); it just requires GLOBAL, not a restart.
  • D is wrong because max_user_connections is a separate variable that caps connections per user account - a different concept entirely.

Memory tip: Think "connections to the whole server = whole-server (GLOBAL) scope." Any variable that affects the entire server instance logically can't be scoped to a single session - if you ever see a SET SESSION on a server-wide resource variable, that's your red flag.

Topics

#variable scope#SESSION vs GLOBAL#max_connections#dynamic variables

Community Discussion

No community discussion yet for this question.

Full 1Z0-888 Practice