mysql sets up the query cache

  • 2020-05-07 20:35:34
  • OfStack

You can use the following statement
query_cache_size = 268435456
query_cache_type = 1
query_cache_limit = 1048576
Store under [mysqld] of the /etc/ my.cnf file
Then restart the mysql database
service mysqld restart
mysql's caching mechanism Query Cache is activated. In use, the query cache stores the text of an SELECT query with the corresponding results sent to the client.
If the same query is later received, the server retrieves the result from the query cache instead of analyzing and executing the same query again.
Note: the query cache never returns stale data. When the data is modified, any relevant entries in the query cache are dumped and cleared.
This is true for tables that don't change too often and have a large number of the same queries

Related articles: