In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
I. description
The story goes like this. The MySQL database has a large table of more than 40 gigabytes. The developer executes a single-table query, and as a result, I receive an alarm that the disk space is full. All of a sudden, I didn't calm down. I thought about all kinds of things in my mind who were in trouble, and what I thought most was that ibtmp1 exploded. I looked at it on the first timeline and found the largest file, and the result was the same as I thought. Here we need to see how SQL is written and what the table structure looks like, and then compared with the official website, MySQL may use disk temporary tables when querying, including table joins, sorting, large fields, and so on.
II. Solutions
Temporary solution:
1. Expand the hard drive temporarily
2. Restart directly
Terminating the solution
Procedure:
1. Check the database status
Ps-ef | grep mysql
2. Check the status of the master and backup database
Show slave status\ G
3. Check the database shutdown parameter, which is required to be 1
Show variables like 'innodb_fast_shutdown'
4. Turn off the synchronization process
Stop slave
5. Close the database
Shutdown
6. Set database temporary tablespace parameters
# / etc/my.cnf
Innodb_temp_data_file_path = ibtmp1:12M:autoextend:max:10G
7. Start database service and synchronize threads
Mysqld_safe-- defaults-file=/etc/my.cnf &
Start slave
Show slave status\ G
8. Check database temporary tablespace parameters
Show variables like 'innodb_temp_data_file_path'
9. View the ibtmp1 file size
Du-sh ibtmp1
Third, Xiao Jie
1. Never underestimate a select xxx from tab; if you don't know what you're doing and the risks, don't hit any instructions in the production system.
2. Be in awe.
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.