MySQL 8.0 Reference Manual  /  MySQL Data Dictionary  /  Data Dictionary Schema

Pre-General Availability Draft: 2017-07-23

14.1 Data Dictionary Schema

Data dictionary tables are invisible and may only be accessed using a debug build of MySQL. However, MySQL supports access to data stored in data dictionary tables through INFORMATION_SCHEMA tables and SHOW statements. For an overview of the tables that comprise the data dictionary, see Data Dictionary Tables.

MySQL system tables still exist in MySQL 8.0 and can be viewed by issuing a SHOW TABLES statement on the mysql system database. Generally, the difference between MySQL system tables and data dictionary tables is that system tables contain auxiliary data such as time zone and help information, whereas data dictionary tables contain data required to execute SQL queries. MySQL system tables and data dictionary tables also differ in how they are upgraded. Upgrading MySQL system tables requires running mysql_upgrade. Data dictionary upgrades are managed by the MySQL server.

Viewing Data Dictionary Tables Using a Debug Build of MySQL

Data dictionary tables are hidden by default but may be accessed by compiling MySQL with debugging support using the -DWITH_DEBUG=1 CMake option and specifying the +d,skip_dd_table_access_check debug option and modifier. For information about compiling debug builds, see Section 28.5.1.1, “Compiling MySQL for Debugging”.

Warning

Modifying or writing to data dictionary tables directly is not recommended and may render your MySQL instance inoperable.

After compiling MySQL with debugging support, use this SET statement to make data dictionary tables visible to the mysql client session:

mysql> SET SESSION debug='+d,skip_dd_table_access_check';

Use this query to retrieve a list of data dictionary tables:

mysql> SELECT name, schema_id, hidden, type FROM mysql.tables where schema_id=1 AND hidden='System';

Use SHOW CREATE TABLE to view data dictionary table definitions. For example:

mysql> SHOW CREATE TABLE mysql.catalogs\G

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