In this article, we will share with you how to modify the tmpdir parameter in MySQL in linux to solve the problem of tmpdir errors. if you have the same requirements, you can refer to the next alarm message that you suddenly receive today, yes/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 '; + --------------- + percent + | Variable_name | Value | + --------------- + percent + | tmpdir |/mysql5.6/var/tmp | + --------------- + percent + 1 row in set (0.00 sec)
Q: But the service cannot be restarted in the production environment. how can this problem be solved?