Question is similar to MySQL dump by query but with the difference that the SELECT query I want is super long (almost 1000 lines)
So just to put it in perspective,
mysql -e "SELECT * from myTable WHERE id NOT IN (*lots of specific id numbers*)" -u myuser -pxxxxxxxxx mydatabase > output.txt
How can I achieve this?
I also tried going into the DB itself and running the query there and adding INTO OUTFILE '/tmp/querydump.csv'
in the end but get the error;
ERROR 1045 (28000): Access denied for user 'admin'@'%' (using password: YES)
Any helpful tips please? Thanks in advance.