<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="cannot-create">
      </a>
      B.3.2.11 Can't create/write to file
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045054253104">
  </a>
  <p>
   If you get an error of the following type for some queries, it
          means that MySQL cannot create a temporary file for the result
          set in the temporary directory:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-none"><div class="docs-select-all right" id="sa90116259"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-none">Can't create/write to file '\\sqla3fe_0.ism'.</code></pre>
  </div>
  <p>
   The preceding error is a typical message for Windows; the Unix
          message is similar.
  </p>
  <p>
   One fix is to start
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   with the
   <a class="link" href="server-options.html#option_mysqld_tmpdir">
    <code class="option">
     --tmpdir
    </code>
   </a>
   option or to add the
          option to the
   <code class="literal">
    [mysqld]
   </code>
   section of your
          option file. For example, to specify a directory of
   <code class="filename">
    C:\temp
   </code>
   , use these lines:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-ini"><div class="docs-select-all right" id="sa52634924"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-ini"><span class="token selector">[mysqld]</span>
<span class="token constant">tmpdir</span><span class="token attr-value"><span class="token punctuation">=</span>C:/temp</span></code></pre>
  </div>
  <p>
   The
   <code class="filename">
    C:\temp
   </code>
   directory must exist and have
          sufficient space for the MySQL server to write to. See
   <a class="xref" href="option-files.html" title="6.2.2.2 Using Option Files">
    Section 6.2.2.2, “Using Option Files”
   </a>
   .
  </p>
  <p>
   Another cause of this error can be permissions issues. Make
          sure that the MySQL server can write to the
   <a class="link" href="server-system-variables.html#sysvar_tmpdir">
    <code class="literal">
     tmpdir
    </code>
   </a>
   directory.
  </p>
  <p>
   Check also the error code that you get with
   <a class="link" href="perror.html" title="6.8.1 perror — Display MySQL Error Message Information">
    <span class="command">
     <strong>
      perror
     </strong>
    </span>
   </a>
   . One reason the server cannot write
          to a table is that the file system is full:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa27776411"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">perror</span> 28
OS error code  28<span class="token punctuation">:</span>  No space left on device</code></pre>
  </div>
  <p>
   If you get an error of the following type during startup, it
          indicates that the file system or directory used for storing
          data files is write protected. Provided that the write error
          is to a test file, the error is not serious and can be safely
          ignored.
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-none"><div class="docs-select-all right" id="sa88151815"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-none">Can't create test file /usr/local/mysql/data/master.lower-test</code></pre>
  </div>
 </div>
 <br/>
</div>
