Access denied error on select into outfile using Zend
- by Peter
Hi,
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:
public function dumpTable()
{
$db = $this->getDbTable()->getAdapter();
$name = $this->getDbTable()->info('name');
$backupFile = APPLICATION_PATH .
'/backup/' . date('U') .
'_' . $name . '.sql';
$query = "SELECT * INTO OUTFILE '$backupFile' FROM $name";
$db->query( $query );
}
This should work peachy, I thought, but
Message: Mysqli prepare error: Access denied for user 'someUser'@'localhost' (using password: YES)
is what this results in.
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).
What am I doing wrong here? Or, does anybody know a more elegant way to get this done in Zend?