MySQL 5.7 Reference Manual Including MySQL NDB Cluster 7.5 and NDB Cluster 7.6

25.12.16.1 The host_cache Table

The host_cache table provides access to the contents of the host cache, which contains client host name and IP address information and is used to avoid Domain Name System (DNS) lookups. The host_cache_size system variable controls the size of the host cache, as well as the size of the host_cache table that exposes the cache contents. For operational and configuration information about the host cache, see Section 8.12.5.2, “DNS Lookup Optimization and the Host Cache”.

Because the host_cache table exposes the contents of the host cache, it can be examined using SELECT statements. This may help you diagnose the causes of connection problems. The Performance Schema must be enabled or this table is empty.

The host_cache table has these columns:

The FLUSH HOSTS statement, TRUNCATE TABLE host_cache statement, and mysqladmin flush-hosts command have the same effect: They clear the host cache, remove all rows from the host_cache table that exposes the cache contents, and unblock any blocked hosts (see Section B.4.2.5, “Host 'host_name' is blocked”). FLUSH HOSTS and mysqladmin flush-hosts require the RELOAD privilege. TRUNCATE TABLE requires the DROP privilege for the host_cache table.