Change output format for MySQL command line results to CSV

前端 未结 7 2060
囚心锁ツ
囚心锁ツ 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:12

    If you are using mysql client you can set up the resultFormat per session e.g.

    mysql -h localhost -u root --resutl-format=json
    

    or

    mysql -h localhost -u root --vertical
    

    Check out the full list of arguments here.

提交回复
热议问题