Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of setting cache in mysql

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to set up cache in mysql. Xiao Bian thinks it is quite practical, so share it for everyone to make a reference. Let's follow the editor and have a look.

The cache setting method in mysql: 1. Enable the self cache function [show variables like "%cache%"];2. Set the self cache to 32M [set global query_cache_size = 1024 * 1024 * 32;].

Methods of caching settings in mysql:

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

# show variables like "%cache%"

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

query_cache_size: Size of MySQL's own cache, in bytes

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

# set global query_cache_size = 1024 * 1024 * 32;

Run some comparative tests.

query_cache_size=0;

3. Inquiry

4. Open MySQL cache (32 MB space)

5. When modifying the case of words in a query statement, the query result remains unchanged, but MySQL's own cache considers this to be a different query and will cache it here (MySQL's own cache is strictly based on the case of sql statements).

Thank you for reading! About mysql set cache method shared here, I hope the above content can have some help for everyone, so that we can learn more knowledge. If you think the article is good, you can share it so that more people can see it!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report