Can't create/write to file (Errcode: 22)

前端 未结 2 928
再見小時候
再見小時候 2021-01-15 12:29

Quite new with SQL I\'m looking to export some data from a MySQL database into a csv file. I\'m working locally (localhost).

Here is my SQL statement:



        
相关标签:
2条回答
  • 2021-01-15 12:56

    It looks like the back-slashes may be affecting the command. Try using '\\' instead of '\'.

    0 讨论(0)
  • 2021-01-15 12:57

    SELECT * FROM TableName WHERE condition INTO OUTFILE 'E:/test/filename.csv';

    You are having issue with the back slash. Using forward slash resolved the issue in windows machine. But in Ubuntu its not working.

    Then I tried with the below mentioned Query and it works:

    SELECT * FROM TableName WHERE condition INTO OUTFILE '//tmp/test/filename.csv';

    Here the double slash when starting the path is necessary.

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