MySQL tmpdir參數修改

來源:互聯網
上載者:User

MySQL tmpdir參數修改

今天突然收到警示簡訊,說是/磁碟空間使用超過閥值。經查看,發現是有很多異常的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)

問一下:但是生產環境不能重啟服務,這要怎麼搞呢?

本文永久更新連結地址:

相關文章

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.