MySQL 8.0: The Query Cache Is Gone (MariaDB Kept It)

MySQL removed the query cache entirely in 8.0 after deprecating it in 5.7; MariaDB, a fork of the same codebase, chose to keep it — a lasting divergence.

MySQL 5.7 → MySQL 8.0

Quick answer

If you're upgrading from MySQL 5.7 to 8.0, the query cache and every related variable (query_cache_size, query_cache_type, etc.) are gone — there is nothing to re-enable. If you're moving from MySQL to MariaDB instead, the query cache still exists there and behaves as it always has.

Why it matters

Configuration management scripts, monitoring dashboards, and tuning guides that reference query_cache_* variables will error on MySQL 8.0 (unknown system variable) but continue to work on MariaDB — a subtle trap if your infrastructure scripts assume 'MySQL-compatible' means the same thing across both.

What to do about it

Migration steps

  • Remove all query_cache_* settings from MySQL 8.0 configuration files — they will prevent the server from starting if present as hard variable assignments.
  • If query caching was actually load-bearing for performance, evaluate application-level caching (Redis/Memcached) or MySQL 8.0's improved buffer pool and index statistics instead — there is no server-side drop-in replacement.

References

  • MySQL 8.0 Reference Manual — The MySQL Query Cache (Removed) (v8.0) — checked 2026-07-31
  • MariaDB Knowledge Base — Query Cache — checked 2026-07-31

Last verified 2026-07-31.