MySQL Internals Manual  /  Tracing the Optimizer  /  Preventing Use of Optimizer Trace

8.16 Preventing Use of Optimizer Trace

If for some reason, as DBA of a MySQL Server, you wish to prevent all users from seeing traces of their queries, start the server with these options:

--maximum-optimizer-trace-max-mem-size=0 --optimizer-trace-max-mem-size=0

This sets the maximum size to 0 and prevents users from changing this limit, thus truncating all traces to 0 bytes.