Bug #13868 Access denied with SELECT..INTO OUTFILE FROM information_schema.schemata table
Submitted: 9 Oct 2005 9:47 Modified: 9 Oct 2005 11:00
Reporter: Roland Bouman Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.13 OS:Windows (Win XP Professional SP2)
Assigned to: CPU Architecture:Any

[9 Oct 2005 9:47] Roland Bouman
Description:
A SELECT...INTO OUTFILE query FROM a table that resides in the information_schema database gives and error message, claiming that Access is denied. This is wrong: the information_schema database is accessible to every user, and this error should never occur for the information_schema database tables. The equivalent query without the INTO OUTFILE clause returns te results as expected.

How to repeat:
select *
into   outfile 'D:\\temp\\myoutfile1.txt'
from   information_schema.schemata
;

gives me: 
ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'information_schema'

however this: 

select *
from   information_schema.schemata
;

works as expected and returns the results

Suggested fix:
Make INTO OUTFILE behave, and store the results in the file.
[9 Oct 2005 11:00] Carsten Segieth
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the original bug instead.

Thank you for your interest in MySQL.
[9 Oct 2005 11:02] Carsten Segieth
this is a duplicate of http://bugs.mysql.com/bug.php?id=13202 "SELECT * INTO OUTFILE ... FROM information_schema.schemata now fails"
[9 Oct 2005 11:35] Roland Bouman
I'm so sorry to've bothered you with this duplicate. I guess I missed it browsing through the list after I searched (Yep, i did search first).