Output table column names to a file

I’m working on tool to transfer data from one database to another. I wanted a list of column names in a file so that I had a list I could work through. After a hunt around the MySQL docs I found mysqlshow, which works a treat:

  mysqlshow -u username -p password database_name table_name > output.txt
This entry was posted in SQL. Bookmark the permalink.