MySQL tmpdir Parameter Modification

Source: Internet
Author: User

MySQL tmpdir Parameter Modification

Today, I suddenly received an alert message saying that/the disk space usage exceeds the threshold. It was found that there were many abnormal SQL statements that could not be executed, resulting in continuous processing, resulting in temporary use of/tmp disk space.

Because the/tmp space of the operating system is limited, You need to modify the parameter and modify the value path of tmpdir.

Mysql> show variables like 'tmpdir ';
+ --------------- + ------- +
| Variable_name | Value |
+ --------------- + ------- +
| Tmpdir |/tmp |
+ --------------- + ------- +
1 row in set (0.00 sec)

Mysql> set global tmpdir = '/Data/app/mysql5.6.25/mysqltmp ';
ERROR 1238 (HY000): Variable 'tmpdir' is a read only variable

You can only modify the configuration file.
Restart mysql
Mysql> show variables like 'tmpdir ';
+ --------------- + -------------------------------- +
| Variable_name | Value |
+ --------------- + -------------------------------- +
| Tmpdir |/mysql5.6/var/tmp |
+ --------------- + -------------------------------- +
1 row in set (0.00 sec)

Q: but the service cannot be restarted in the production environment. How can this problem be solved?

This article permanently updates the link address:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.