# Outfile huge table caused error

**URL:** <https://forums.percona.com/t/outfile-huge-table-caused-error/1345>\
**Category:** Other MySQL® Questions\
**Created:** [February 8, 2010, 3:13am UTC](https://forums.percona.com/t/outfile-huge-table-caused-error/1345 "2010-02-08T03:13:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fedoragetit](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@fedoragetit](https://forums.percona.com/u/fedoragetit)\
**Post date:** [February 8, 2010, 3:13am UTC](https://forums.percona.com/t/outfile-huge-table-caused-error/1345/1 "2010-02-08T03:13:40Z")

</div>

Hi,

i have a table which contains 10 millions records and i want to have full dump in outfile in CSV format. But there is error regarding disk full.  
I am getting the following error

100206 4:13:13 [ERROR] /usr/libexec/mysqld: Incorrect key file for table ‘#sql\_64e8\_0.MYI’; try to repair it  
100206 4:13:13 [ERROR] /usr/libexec/mysqld: Disk is full writing ‘/var/log/mysql/slonj157.016913’ (Errcode: 28). Waiting for someone to free space… Retry in 60 secs  
100206 4:23:23 [ERROR] /usr/libexec/mysqld: Incorrect key file for table ‘#sql\_64e8\_0.MYI’; try to repair it  
100206 4:23:23 [ERROR] /usr/libexec/mysqld: Disk is full writing ‘/var/log/mysql/slonj157.016916’ (Errcode: 28). Waiting for someone to free space… Retry in 60 secs

I have used the below query to generate outfile  
${MYSQL} -u$db\_user -p$db\_pass ${DATABASE} -Bse “set max\_heap\_table\_size= 1073741824; set tmp\_table\_size= 1073741824;select  
‘id’,‘asin’,‘title’,‘artist’,‘modified’,‘created’ union  
select id,asin,title,artist,modified,created from table\_name INTO OUTFILE "/tmp/table\_name.csv" FIELDS TERMINATED BY "^~"  
OPTIONALLY ENCLOSED BY ‘"’ LINES TERMINATED BY ‘\n’;”

As tmp size is only 512MB i have set 1Gb in session.So why i am getting this error? There is more than 24 GB space in / folder.

Thanks In advance.

Fedora

---

<div class="post-metadata">

**Author:** ![gmouse](https://avatars.discourse-cdn.com/v4/letter/g/b9e5f3/32.png) [@gmouse](https://forums.percona.com/u/gmouse)\
**Post date:** [February 8, 2010, 10:13am UTC](https://forums.percona.com/t/outfile-huge-table-caused-error/1345/2 "2010-02-08T10:13:00Z")

</div>

/var is mounted on a different partition? WHat’s the output of df?

---

<div class="post-metadata">

**Author:** ![fedoragetit](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@fedoragetit](https://forums.percona.com/u/fedoragetit)\
**Post date:** [February 8, 2010, 11:00am UTC](https://forums.percona.com/t/outfile-huge-table-caused-error/1345/3 "2010-02-08T11:00:43Z")

</div>

Below are the output of df -h

Filesystem Size Used Avail Use% Mounted on  
/dev/mapper/Vol00  
39G 13G 24G 36% /  
/dev/p1 97M 27M 65M 30% /boot  
tmpfs 7.9G 0 7.9G 0% /dev/shm
