今天突然收到报警短信,说是/磁盘空间使用超过阀值。经查看,发现是有很多异常的sql,执行不了,导致一直在处理,产生了临时占用了/tmp磁盘空间。
由于操作系统的/tmp空间有限,需要进行参数修改,将tmpdir的值路径进行修改。
<a style='color:#f60; text-decoration:underline;' href="https://www.php.cn/zt/15713.html" target="_blank">mysql</a>> 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
只能通过配置文件进行修改了。
重启mysql
mysql> show variables like 'tmpdir'; +---------------+--------------------------------+ | Variable_name | Value | +---------------+--------------------------------+ | tmpdir | /mysql5.6/var/tmp | +---------------+--------------------------------+ 1 row in set (0.00 sec)
问一下:但是生产环境不能重启服务,这要怎么搞呢?
Copyright 2014-2024 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号