In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
In many linux production servers, the database is mysql very often, which is a lightweight database in the database, but there are often some problems in the long-term use. The general situation is that the table can not be read. At this time, we have to repair the table, optimize the table and reduce the disk usage to facilitate the backup of the database.
When using root to enter the mysql, enter the library where the table is located
REPAIR TABLE `table_ name` repair table OPTIMIZE TABLE `table_ name` optimization table
The function of REPAIR TABLE is to repair the table, while OPTIMIZE TABLE is used to reclaim the idle database space. When the data rows on the table are deleted, the disk space occupied is not immediately reclaimed. After using the OPTIMIZE TABLE command, the disk space is reclaimed and the data rows on the disk are rearranged. In many cases, OPTIMIZE TABLE does not have to be run, as long as the table is optimized on a regular basis, such as once a week or once a month, after batch deletion, so as to reduce the disk space occupied by the table data. Of course, in the process of repair, we should also pay attention to the file properties of the mysql table file table_name.frm, because sometimes when the compiled version of mysql does not have the startup script in init.d, it is started by the mysqld_safe tool in the bin directory under mysql, and sometimes if the startup user is not specified or the startup user is not the user used by the mysql software, there will be problems with the mysql table file. There will be a series of problems such as unable to read files, so sometimes we have to use chown to modify the permissions of mysql table files to achieve repair.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.