Documentation Home
MySQL 5.7 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 38.0Mb
PDF (A4) - 38.0Mb
PDF (RPM) - 37.3Mb
HTML Download (TGZ) - 10.2Mb
HTML Download (Zip) - 10.2Mb
HTML Download (RPM) - 8.9Mb
Man Pages (TGZ) - 216.6Kb
Man Pages (Zip) - 329.3Kb
Info (Gzip) - 3.5Mb
Info (Zip) - 3.5Mb
Excerpts from this Manual

MySQL 5.7 Reference Manual  /  MySQL sys Schema

Chapter 26 MySQL sys Schema

MySQL 5.7.7 and higher 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:

  • 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.

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, or if you use mysql_install_db. To permit this behavior to be suppressed, mysql_install_db has a --skip-sys-schema option. mysqld has no such option, but if you initialize the data directory using mysqld --initialize (or --initialize-insecure) rather than mysql_install_db, you can drop the sys schema manually after initialization if it is unneeded.

For upgrades, mysql_upgrade installs the sys schema if it is not installed, and upgrades it to the current version otherwise. To permit this behavior to be suppressed, mysql_upgrade has a --skip-sys-schema option.

mysql_upgrade returns 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.

As of MySQL 5.7.9, sys schema objects have a DEFINER of 'mysql.sys'@'localhost'. (Before MySQL 5.7.9, the DEFINER is 'root'@'localhost'.) Use of the dedicated mysql.sys account avoids problems that occur if a DBA renames or removes the root account.


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