Home  >  Article  >  Database  >  How to set up cache in mysql

How to set up cache in mysql

coldplay.xixi
coldplay.xixiOriginal
2020-10-28 16:01:002871browse

How to set cache in mysql: 1. Turn on the self-cache function [show variables like “�che%”]; 2. Set the self-cache to 32M [set global query_cache_size = 1024 * 1024 * 32;] .

How to set up cache in mysql

How to set cache in mysql:

1. You need to enable MySQL’s own cache function

# show variables like “%cache%”

How to set up cache in mysql

2, query_cache_type: The startup state of MySQL's own cache is enabled by default, but there is no space size

query_cache_size : The size of MySQL's own cache, the unit is B (byte)

If you need to set MySQL's own cache to 32 M

# set global query_cache_size = 1024 * 1024 * 32;

Do some comparison tests

 query_cache_size=0;

How to set up cache in mysql

3. Query

How to set up cache in mysql

4. Enable MySQL’s own cache (32M space)

How to set up cache in mysql

5. When the word case of the query statement is modified, the query result remains unchanged, but MySQL's own cache thinks this is a different query and will cache it here (MySQL's own cache is strictly based on the case of the SQL statement) )

How to set up cache in mysql

More related free learning recommendations: mysql tutorial (video)

The above is the detailed content of How to set up cache in mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn