Home  >  Article  >  Database  >  MySQL修改tmpdir参数_MySQL

MySQL修改tmpdir参数_MySQL

WBOY
WBOYOriginal
2016-05-27 13:45:231673browse

今天突然收到报警短信,说是/磁盘空间使用超过阀值。经查看,发现是有很多异常的SQL,执行不了,导致一直在处理,产生了临时占用了/tmp磁盘空间。

由于操作系统的/tmp空间有限,需要进行参数修改,将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

只能通过配置文件进行修改了。

重启mysql

mysql> show variables like 'tmpdir';
+---------------+--------------------------------+
| Variable_name | Value             |
+---------------+--------------------------------+
| tmpdir    | /mysql5.6/var/tmp |
+---------------+--------------------------------+
1 row in set (0.00 sec)

问一下:但是生产环境不能重启服务,这要怎么搞呢?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn