Reputation: 16081
The following command:
select *
INTO OUTFILE '\home\user1\NetBeansProjects\project1\dumps\theData.csv'
FIELDS TERMINATED by ','
LINES TERMINATED BY '\n'
from database1
Does not write a file called theData.csv to the specified directory.
Upvotes: 6
Views: 4895
Reputation: 46
The path doesn't seem write - if you are on Linux server then I would expect the path with contains slashes and not backslashes, if you are on Windows machine I would expect the driver letter to appears somewhere (and you can't write on a network folder - just local to the DB server machine).
Also, just to eliminate permissions issue or trying to override existing file, try to write to '/tmp/non_existing_file.csv'.
Upvotes: 3
Reputation: 71
Are you using Windows or Linux? You might need to change the back slashes to forward slashes. Also you need to change the settings in MySQL Query browser or Workbench to view this folder as default.
Upvotes: 0