i need to export data from a table to a csv. i have the following structure (not really my table but for demo purposes)
CREATE TABLE `mytable` (
`id` int(11) DEFAULT NULL,
`mycolumn` varchar(25) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
with data (about 3000 records). now i want to export some of these records (from a script i run via cronjob)
SELECT * INTO OUTFILE '/tmp/mytable.sql'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM mytable;
it shows:
Query OK, 3 rows affected (0.00 sec)
then i do:
ls: cannot access /tmp/mytable.sql: No such file or directory
where is my file?