Home > Database > Mysql Tutorial > How to set up cache in mysql

How to set up cache in mysql

coldplay.xixi
Release: 2020-10-29 16:22:41
Original
2903 people have browsed it

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%”
Copy after login

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;
Copy after login

Do some comparison tests

 query_cache_size=0;
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template