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 cleaning up the mysql Space of Aliyun

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Today, I received a disk alarm notice from Aliyun. I checked that a 100g of space has reached 80g of usage. If I decided to delete the data before January 1, 2018, after delete, I found that the available disk space did not decrease and rose rapidly, which worried me to death, and soon the database was locked.

Dare to find du Niang, the original delete, the disk will not be reduced, but also have to execute OPTIMIZE TABLE + table name, later found the savior, but the execution of this life letter is not successful, the original is insufficient space, data inventory lock can not execute this instruction, once there is no clue, if you decide to pause the server first, in the pause miracle happened, the available space is more than 5G, now you can execute OPTIMIZE TABLE to optimize the table, can be executed 3 minutes later The instruction returned an error, as soon as there was insufficient space, the table was locked again.

The most decided, first export a table, transfer the sql file, a full 40 minutes before the import, and then delete the table, the server at a time more than 50 GB of free space, so run the sql file to restore the data, a full 150 minutes. After the execution, 70 GB of the disk was used, and then the OPTIMIZE TABLE + table name was executed. because one of the tables was too large, it took nearly 40 minutes to execute, during which the disk utilization rate rose to 100%. Fortunately, it just passed.

The mysql space will not be reduced after delete data. You only need to execute OPTIMIZE TABLE, during which a large number of temporary files will be generated. If the original table volume is very large, it will take up a lot of space. Therefore, when executing this rule, be sure to use sufficient disk space. Otherwise, executing something else will cause insufficient disk, lock up the database, and cause the execution to fail.

Summary

The above is the whole content of this article. I hope the content of this article has a certain reference and learning value for everyone's study or work. Thank you for your support. If you want to know more about it, please see the relevant links below.

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

Servers

Wechat

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

12
Report