How can I save the MySQL query output to file on a Windows machine?
Question
Let's say I want to save the whole list of the collations supported by MySQL into file.
How can I save the result of the show collation
into .txt
file?
The OS I'm using is Windows. I tried something like this: show collation INTO OUTFILE 'c:\aaa.txt';
or show collation > c:\aaa.txt;
but it doesn't work.
Solution
select *
into outfile 'filepath.txt'
from information_schema.collations;
OTHER TIPS
C: mysql -e "select * from information_schema.collations" >collations.txt
Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange