Change output format for MySQL command line results to CSV

前端 未结 7 2047
囚心锁ツ
囚心锁ツ 2020-12-05 03:54

I want to get headerless CSV data from the output of a query to MySQL on the command line. I\'m running this query on a different machine from the MySQL server, so all those

相关标签:
7条回答
  • 2020-12-05 04:38

    As a partial answer: mysql -N -B -e "select people, places from things"

    -N tells it not to print column headers. -B is "batch mode", and uses tabs to separate fields.

    If tab separated values won't suffice, see this Stackoverflow Q&A.

    0 讨论(0)
提交回复
热议问题