Re: Strange response to MySQL query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, February 14, 2006 11:50 am, tedd wrote:
> Hi gang:
>
> I'm trying to dump a BLOB into a file for subsequent processing.
>
> To do this I'm using the query statements:
>
> $dbQuery = "SELECT  image ";
> $dbQuery .= "FROM flowers ";
> $dbQuery .= "WHERE image_Id=$pic_id ";
> $dbQuery .= "INTO DUMPFILE  '/tmp/test.jpg' ";
>
> But, it generates an "Access denied.." error.
>
> However, if I comment-out the last line, namely "INTO DUMPFILE"
> statement, then the code accesses the dB (i.e., no access problems).
>
> In thinking it might be permission related, I set permissions for the
> tmp folder and file to 777, but that didn't help.
>
> Any ideas? I've busted my head on this for several hours now.

Not only would MySQL need access to that file, but the MySQL user you
login as, and the location from which it logs in (presumably
'localhost', but we don't know) can be constrained in MySQL itself to
deny access to altering the file-system.

To confirm this, execute the following queries:
$dbQuery = "describe mysql.user";

This will tell you which columns are what, if you are even allowed to
execute this query in the first place... It may ALSO give you:
Access denied.

$dbQuery = "select * from mysql.user where user = 'MySQLUSERNAME'";

Again, you may not have permission to execute that query either!

In other words, you have not yet reached the sublime joy of the file
system denying you access to itself -- You are still in the realm of
MySQL denying you access to the file system. :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux