I want to save a MySQL query result to to a text file like this:
SELECT * FROM orders INTO OUTFILE '/data.txt'
However, I don't have write permission on the server. Where can I write to or is there a simpler way?
use this command:
mysql -uroot -p -e "select * from database_name.table_name" > filename.txt
Enter the password and all is done
select * into outfile 'sd1.txt' from orders;
or
select * into outfile 'sd1.sql' from orders;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With