2

I'm running an Ubuntu Server with Plesk and I need to export a file (xls) from MySQL using OUTFILE. I have this query:

SELECT * FROM table INTO OUTFILE 'xxxxxx.xls'

The file is saved into folder /var/lib/mysql/

I can create other folders inside mysql folder too and it works, but the question is, how can i save the file into a folder outside mysql folder, something like /var/www/something/ ?

If I try this example I get MySQL Errcode: 13 (Can't create/write to file). I researched this into MySQL docs and this could be a permissions issue (See: http://dev.mysql.com/doc/refman/5.0/en/cannot-create.html). I checked the permissions on the folder and everything seems to be correct. Anyone have more information on how to solve this problem?

Martín
  • 3,105
  • 7
  • 25
  • 43
  • How about `select * from table into outfile '/var/www/something/xxxxx.xls'`? – Jashaszun Aug 07 '14 at 18:23
  • Hi Jashaszun, that's what causes the error to which I refer (Errcode: 13). – Martín Aug 07 '14 at 18:25
  • 1
    I tryed this solution too but nothing: http://stackoverflow.com/questions/2783313/how-can-i-get-around-mysql-errcode-13-with-select-into-outfile?rq=1 Maybe something with Plesk? – Martín Aug 07 '14 at 18:36
  • A workaround solution was posted in the thread posted by @Martín, check it out https://stackoverflow.com/a/22500728/863923 – Hamman Samuel May 15 '20 at 20:18

0 Answers0