I'm working with a remote server to which I access via ssh. At the server there's a mysql database from which I'm making query
SELECT * FROM my_table where date > '2010-01-01'';
So far so good, the issue raises when I tray to create an output file:
SELECT * FROM my_table where date > '2010-01-01' INTO OUTFILE '/home/ubuntu/data/my_output.csv';
I getting a permission error:
ERROR 1 (HY000): Can't create/write to file '/home/ubuntu/data/my_output.csv' (Errcode: 13)
Is there a way sent the file directly to my local machine instead of writing it first on the server where I don't have permissions to write files from the database?