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

How to use the MySQL parameter

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to use MySQL parameters, and the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.

How to use the MySQL parameter

When createtable, specify DELAY_KEY_WRITE.

When the table already exists: ALTERTABLEtable_nameDELAY_KEY_WRITE=1.

Scope of application: the table has update operation, the advantage of this parameter will be well reflected. Because this parameter delays updating the index until the table is closed. We can consider using this parameter when we need to follow a new large table frequently.

Description: when will the watch shutdown occur? You can understand that when flashtable, the table will be closed. Then there are two things that will happen to flushtable:

When cache is full of a new thread and tries to open a table, that table is not in the cache

Thread is no longer using tables when there are more tables in cache than in table_cache

These two cases will be flushtable.

Of course, you can also directly set the startup parameter flush_time and set how many times you flushtable.

What do MySQL parameters need to pay attention to?

When DELAY_KEY_WRITE is in use, if there is a restart or power failure, the index update in cache will not be updated in time, so you must add-- myisam-recover to the startup parameter so that you will check your table and synchronize the table and index when you start mysql. Or run myisamchk before restarting the server. However, even in this case, no data loss should be guaranteed by using DELAY_KEY_WRITE, because keyword information can always be generated from the data row. If you use this feature, you start the server with the-- myisam-recover option and add automatic checks for all MyISAM tables.

On how to use MySQL parameters to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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