SELECT INTO OUTFILE can't write to file

前端 未结 4 651
再見小時候
再見小時候 2021-01-04 13:18

I\'m trying to do a SELECT INTO OUTFILE and I\'m getting the following error:

General error: 1 Can\'t create/write to file \'/home/jason/project         


        
相关标签:
4条回答
  • 2021-01-04 13:48

    write the file /tmp/dump.csv and the copy it over.. That will let you see who is running what. My guess is that you are doing this from the web and the client is running as the web server process...

    0 讨论(0)
  • 2021-01-04 14:00

    mysql -u USERNAME --password=PASSWORD --database=DATABASE --execute='SELECT FIELD, FIELD FROM TABLE LIMIT 0, 10000 ' -X > file.xml

    0 讨论(0)
  • 2021-01-04 14:09

    Here's a discussion that may help: How can I have MySQL write outfiles as a different user?

    Also, please try to avoid clouding your questions with fluff. In your case, you already know it's a permissions issue, so all of your SQL joins and tables don't matter. You could have simply used one field from one table in your select, to demonstrate the problem without clouding things up.

    0 讨论(0)
  • 2021-01-04 14:10

    the client will probably be mysqld. you must change apparmor authorizations and it will work fine. check out this answer

    0 讨论(0)
提交回复
热议问题