1

I would like to get more or less what is discussed in this question.

What more? I would like to redirect the output to a file.

What less? The SHOW columns FROM your-table; actually returns a lot of stuff. In addition to column names it also shows i.e. type.

Ideally, in the end, I would like a plain text file listing one column name per line.

Community
  • 1
  • 1
KcFnMi
  • 5,516
  • 10
  • 62
  • 136
  • Did you read the manual of your mysql command line client? There is an option to output to a file.. There is also http://dev.mysql.com/doc/refman/5.7/en/select-into.html –  Apr 19 '16 at 14:03
  • What's wrong with the answer here: http://stackoverflow.com/a/4165253/1015327? – JimmyB Apr 19 '16 at 14:07
  • Something like `"C:\mysql-5.6.17-winx64\bin\mysql" -h localhost -uuser -ppassword -e"use db_my_db; select * from my_view;" >> test.txt` helps. – KcFnMi Apr 19 '16 at 14:19
  • 1
    May be you are looking for [link](http://stackoverflow.com/questions/5525970/mysql-show-columns-but-exclude-everything-except-the-field-names) – vinit Apr 19 '16 at 14:51

0 Answers0