I am trying to write some data from a MySQL select statement to a file on a Mac running Snow Leopard.
select date_base, fractile_v2, gics, count(gvkey_iid)
from master
where fractile_v2 <= 15 and
fractile_v2 != 0
group by date_base, gics, fractile_v2
order by date_base, fractile_v2
limit 100000
INTO OUTFILE '/User/my-name/Desktop/gics_v2.csv'
FIELDS TERMINATED BY ',';
Unfortunately, this causes the following error:
Error code: 1. Unable to create / write to file '/Users/andrew/Desktop/gics_v2.csv' (Errcode: 13)
which I assume is a permission issue.
When I replace the full path to a file with a '/User/my-name/Desktop/gics_v2.csv'simple one gics_v2.csv, the instructions seem to be executing. However, I have no idea where the file is saved, and I cannot find it.
Somebody knows? And can anyone also suggest how I can solve the initial write error? I use MySQL as root user.
source
share