Chapter 28 MySQL sys Schema Table of Contents 28.1 Prerequisites for Using the sys Schema 28.1 Prerequisites for Using the sys Schema ................................................................................. 5131 28.2 Using the sys Schema .......................................................................................................... 5132 28.3 sys Schema Progress Reporting ............................................................................................ 5133 28.4 sys Schema Object Reference .............................................................................................. 5134 28.4.1 sys Schema Object Index ........................................................................................... 5134 28.4.2 sys Schema Tables and Triggers ................................................................................ 5138 28.4.3 sys Schema Views ..................................................................................................... 5140 28.4.4 sys Schema Stored Procedures .................................................................................. 5182 28.4.5 sys Schema Stored Functions ..................................................................................... 5202 MySQL 8.0 includes the  sys  schema, a set of objects that helps DBAs and developers interpret data collected by the Performance Schema.  sys  schema objects can be used for typical tuning and diagnosis use cases. Objects in this schema include: For new installations, the  sys  schema is installed by default during data directory initialization if you use mysqld  with the  --initialize  or  --initialize-insecure  option. If this is not desired, you can drop the  sys  schema manually after initialization if it is unneeded. The MySQL upgrade procedure produces an error if a  sys  schema exists but has no  version  view, on the assumption that absence of this view indicates a user-created  sys  schema. To upgrade in this case, remove or rename the existing  sys  schema first. sys  schema objects have a  DEFINER  of  ’mysql.sys’@’localhost’ . Use of the dedicated  mysql.sys account avoids problems that occur if a DBA renames or removes the  root  account. 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 27.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) 5131 •Views that summarize Performance Schema data into more easily understandable form. •Stored procedures that perform operations such as Performance Schema configuration and generating diagnostic reports. •Stored functions that query Performance Schema configuration and provide formatting services.