The mysql database is the system database. It
contains tables that store information required by the MySQL
server as it runs.
Tables in the mysql database fall into these
categories:
The remainder of this section enumerates the tables in each
category, with cross references for additional information. System
tables use the MyISAM storage engine unless
otherwise indicated.
These system tables contain grant information about user accounts and the privileges held by them:
user: User accounts, global privileges,
and other non-privilege columns.
db: Database-level privileges.
host: Obsolete. MySQL install operations
do not create this table as of MySQL 5.6.7.
tables_priv: Table-level privileges.
columns_priv: Column-level privileges.
proxies_priv: Proxy-user privileges.
For more information about the structure, contents, and purpose of the grant tables, see Section 6.2.2, “Grant Tables”.
These system tables contain information about stored programs, user-defined functions, and server-side plugins:
event: Information about Event Scheduler
events. See Section 20.4, “Using the Event Scheduler”. The server
loads events listed in this table during its startup
sequence, unless started with the
--skip-grant-tables option.
func: Information about user-defined
functions (UDFs). See Section 24.4, “Adding New Functions to MySQL”.
The server loads UDFs listed in this table during its
startup sequence, unless started with the
--skip-grant-tables option.
plugin: Information about server-side
plugins. See Section 5.5.2, “Installing and Uninstalling Plugins”, and
Section 24.2, “The MySQL Plugin API”. The server loads plugins
listed in this table during its startup sequence, unless
started with the
--skip-grant-tables option.
proc: Information about stored procedures
and functions. See Section 20.2, “Using Stored Routines (Procedures and Functions)”.
The server uses these system tables for logging:
Log tables use the CSV storage engine.
For more information, see Section 5.4, “MySQL Server Logs”.
These system tables contain server-side help information:
For more information, see Section 5.1.10, “Server-Side Help”.
These system tables contain time zone information:
For more information, see Section 10.6, “MySQL Server Time Zone Support”.
The server uses these system tables to support replication:
ndb_binlog_index: Binary log information
for MySQL Cluster replication. See
Section 18.6.4, “NDB Cluster Replication Schema and Tables”.
slave_master_info,
slave_relay_log_info,
slave_worker_info: Used to store
replication information on slave servers. See
Section 17.2.2, “Replication Relay and Status Logs”.
These tables use the InnoDB storage
engine as of MySQL 5.6.6, MyISAM before
that.
The innodb_index_stats and
innodb_table_stats system tables are used for
InnoDB persistent optimizer statistics. See
Section 14.6.11.1, “Configuring Persistent Optimizer Statistics Parameters”.
These tables use the InnoDB storage engine.
Other system tables do not fall into the preceding categories:
firewall_users,
firewall_whitelist: If MySQL Enterprise Firewall is
installed, these tables provide persistent storage for
information used by the firewall. See
Section 6.5.5, “MySQL Enterprise Firewall”.
servers: Used by the
FEDERATED storage engine. See
Section 15.8.2.2, “Creating a FEDERATED Table Using CREATE SERVER”.