Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 37.4Mb
PDF (A4) - 37.5Mb
PDF (RPM) - 33.8Mb
HTML Download (TGZ) - 8.3Mb
HTML Download (Zip) - 8.4Mb
HTML Download (RPM) - 7.3Mb
Man Pages (TGZ) - 129.8Kb
Man Pages (Zip) - 185.4Kb
Info (Gzip) - 3.3Mb
Info (Zip) - 3.3Mb

MySQL 8.0 Reference Manual  /  MySQL sys Schema  /  Prerequisites for Using the sys Schema

Pre-General Availability Draft: 2018-02-23

27.1 Prerequisites for Using the sys Schema

Before using the sys schema, the prerequisites described in this section must be satisfied.

Because the sys schema provides an alternative means of accessing the Performance Schema, the Performance Schema must be enabled for the sys schema to work. See Section 26.3, “Performance Schema Startup Configuration”.

For full access to the sys schema, a user must have these privileges:

  • SELECT on all sys tables and views

  • EXECUTE on all sys stored procedures and functions

  • INSERT and UPDATE for the sys_config table, if changes are to be made to it

  • Additional privileges for certain sys schema stored procedures and functions, as noted in their descriptions; for example, the ps_setup_save() procedure

It is also necessary to have privileges for the objects underlying the sys schema objects:

Certain Performance Schema instruments and consumers must be enabled and (for instruments) timed to take full advantage of sys schema capabilities:

  • All wait instruments

  • All stage instruments

  • All statement instruments

  • xxx_current and xxx_history_long consumers for all events

You can use the sys schema itself to enable all of the additional instruments and consumers:

CALL sys.ps_setup_enable_instrument('wait');
CALL sys.ps_setup_enable_instrument('stage');
CALL sys.ps_setup_enable_instrument('statement');
CALL sys.ps_setup_enable_consumer('current');
CALL sys.ps_setup_enable_consumer('history_long');

For many uses of the sys schema, the default Performance Schema is sufficient for data collection. Enabling all the instruments and consumers just mentioned has a performance impact, so it is preferable to enable only the additional configuration you need. Also, remember that if you enable additional configuration, you can easily restore the default configuration like this:

CALL sys.ps_setup_reset_to_default(TRUE);

User Comments
Sign Up Login You must be logged in to post a comment.