Would you like to learn how to enable the MySQL query cache feature? In this tutorial, we are going to show you how to configure the query cache to improve the performance of your MySQL server on a computer running Ubuntu Linux.
• Ubuntu 18.04
• MySQL 5.7.31
MySQL version 8 removed the support to query cache.
Equipment list
The following section presents the list of equipment used to create this tutorial.
As an Amazon Associate, I earn from qualifying purchases.
Related tutorial – MySQL
On this page, we offer quick access to a list of tutorials related to MySQL.
Tutorial MySQL – Enable the Query cache
Access the MySQL command-line.
Verify the MySQL query cache status.
Here is the command output.
In our example, the MySQL query cache feature is disabled.
Edit the MySQL configuration file.
Insert the following lines under the area named MYSQLD.
In our example, we enabled the MySQL query cache feature.
In our example, we limited the use of the cache to 100 Megabytes.
In our example, we set the maximum size of a single result set to 1 Megabyte.
Restart the MySQL service.
Verify the MySQL query cache status.
Here is the command output.
Verify details of the MySQL cache configuration.
Congratulations! You successfully enabled the MySQL query cache.