title: Access denied error on select into outfile using Zend
body: <p>I'm trying to make a dump of a MySQL table on the server and I'm trying to do this in Zend. I have a model/mapper/dbtable structure for all my connections to my tables and I'm adding the following code to the mappers:</p>
  
  <pre><code>public function dumpTable()
  {
      $db = $this-&gt;getDbTable()-&gt;getAdapter();
      $name = $this-&gt;getDbTable()-&gt;info('name');
      $backupFile = APPLICATION_PATH . 
                    '/backup/' . date('U') .
                    '_' . $name . '.sql'; 
      $query = "SELECT * INTO OUTFILE '$backupFile' FROM $name";
      $db-&gt;query( $query );               
  }
  </code></pre>
  
  <p>This should work peachy, I thought, but</p>
  
  <pre><code>Message: Mysqli prepare error: Access denied for user 'someUser'@'localhost' (using password: YES) 
  </code></pre>
  
  <p>is what this results in.</p>
  
  <p>I checked the user rights for someUser and he has all the rights to the database and table in question. I've been looking around here and on the net in general and usually turning on "all" the rights for the user seems to be the solution, but not in my case (unless I'm overlooking something right now with my tired eyes + I don't want to turn on "all" on my production server).</p>
  
  <p>What am I doing wrong here? Or, does anybody know a more elegant way to get this done in Zend?</p>