# /tmp No space left on device

**URL:** <https://forums.percona.com/t/tmp-no-space-left-on-device/8104>\
**Category:** Percona Server for MySQL 5.7\
**Tags:** percona\
**Created:** [October 7, 2020, 7:06am UTC](https://forums.percona.com/t/tmp-no-space-left-on-device/8104 "2020-10-07T07:06:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gajendra](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/gajendra/32/44_2.png) [@Gajendra](https://forums.percona.com/u/Gajendra)\
**Post date:** [October 7, 2020, 7:06am UTC](https://forums.percona.com/t/tmp-no-space-left-on-device/8104/1 "2020-10-07T07:06:27Z")

</div>

Hi Team,

I am getting error after executing below query which ran daily in cron

Error : mktemp: failed to create file via template /tmp/pmp-check-mysql-status.XXXXXX: No space left on device

version: mysql 5.7

1\> delete from tableA WHERE status = ‘used’ ;

2\> delete from tableB WHERE expires \< unix\_timestamp(now()) ;

3 \>delete from TABLEC WHERE expires \< unix\_timestamp(now());

4\> delete from TABLED WHERE expires \< unix\_timestamp(now());

above query fetch around 1lac record

i collected data and index stats for above tables

Table\_schema | TABLE\_NAME | Data\_Length(MB) | Index\_Length(MB) | Data\_Free(MB) |

±-------------±-------------------------------±----------------±-----------------±--------------+

| DATABASE\_AB | tableA | 156007 | 1270 | 8663 |

| DATABASE\_AB | tableB | 3885 | 0 | 565 |

| DATABASE\_AB | TABLEC | 19518 | 7441 | 7 |

| DATABASE\_AB | TABLED | 9780 | 4777 | 6 |

so how can i avoid above error

do i need to increase tmp\_table\_size value ? ,the current value is 16MB

or any other setting i have to change

Please help me on this

---

<div class="post-metadata">

**Author:** ![ROHIT\_KHURANA](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/rohit_khurana/32/2760_2.png) [@ROHIT\_KHURANA](https://forums.percona.com/u/ROHIT_KHURANA)\
**Post date:** [October 7, 2020, 11:20pm UTC](https://forums.percona.com/t/tmp-no-space-left-on-device/8104/2 "2020-10-07T23:20:27Z")

</div>

Please change tmpdir to some other mount point where you have enough space. This will help you for bulk queries.

---

<div class="post-metadata">

**Author:** ![Gajendra](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/gajendra/32/44_2.png) [@Gajendra](https://forums.percona.com/u/Gajendra)\
**Post date:** [October 8, 2020, 3:45am UTC](https://forums.percona.com/t/tmp-no-space-left-on-device/8104/3 "2020-10-08T03:45:30Z")

</div>

I have enough on tmpdir

[root@servername~]# df -h /tmp/

Filesystem Size Used Avail Use% Mounted on

/dev/mapper/VG1-LV\_root 25G 3.9G 21G 16% /

---

<div class="post-metadata">

**Author:** ![ROHIT\_KHURANA](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/rohit_khurana/32/2760_2.png) [@ROHIT\_KHURANA](https://forums.percona.com/u/ROHIT_KHURANA)\
**Post date:** [October 12, 2020, 11:07pm UTC](https://forums.percona.com/t/tmp-no-space-left-on-device/8104/4 "2020-10-12T23:07:19Z")

</div>

Then no need to change tmpdir. Just monitor query when you are getting space issue on /tmp. Seems issue with query then.
