MySQL 8.0 Reference Manual Including MySQL NDB Cluster 8.0 The host_cache Table

The MySQL server maintains an in-memory host cache that contains client host name and IP address information and is used to avoid Domain Name System (DNS) lookups. The host_cache table exposes the contents of this cache. The host_cache_size system variable controls the size of the host cache, as well as the size of the host_cache table. For operational and configuration information about the host cache, see Section, “DNS Lookups 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 host_cache table has these columns:

The host_cache table has these indexes:

TRUNCATE TABLE is permitted for the host_cache table. It requires the DROP privilege for the table. Truncating the table flushes the host cache, which has the effects described in Flushing the Host Cache.