1

This query:

SELECT ... INTO OUTFILE '/usr/services/001/tmp/`database4ed78d1eb0986`.`tblTemporaryReportFinishedOrders`.tmp';

Produces this error:

Error Code: 1. Can't create/write to file '/usr/services/001/tmp/`database4ed78d1eb0986`.`tblTemporaryReportFinishedOrders`.tmp' (Errcode: 2)

The /usr/services/001/tmp has 777 permissions so why does it still not work?

I am using FreeBSD OS.

Richard Knop
  • 81,041
  • 149
  • 392
  • 552
  • Try removing the backquotes from the output filename `/usr/services/001/tmp/database4ed78d1eb0986.tblTemporaryReportFinishedOrders.tmp` – Michael Berkowski Dec 09 '11 at 14:45
  • Try taking out the backticks in the filename. `.../001/tmp/database4ed78d1eb0986.tblTemporaryReportFinishedOrders.tmp` – Marc B Dec 09 '11 at 14:45
  • @Michael: Great minds think alike? – Marc B Dec 09 '11 at 14:46
  • @Michael that is not the problem. – Richard Knop Dec 09 '11 at 14:48
  • @Richard: What about 001? MySQL has to have access rights to ALL of the directories in the path, though only needs write permissions on the `tmp` subdir. Does that file exist already? MySQL will **NOT** select into a file that already exists as a security precaution. – Marc B Dec 09 '11 at 14:50
  • Did you grant `file` privilege to your db user? – ravnur Dec 09 '11 at 15:42

1 Answers1

1

File names can't contain those back tics. Try with a valid file name.

Andreas Wederbrand
  • 38,065
  • 11
  • 68
  • 78