write results of sql query to a file in mysql

前端 未结 5 990
心在旅途
心在旅途 2021-02-01 01:44

I\'m trying to write the results of a query to a file using mysql. I\'ve seen some information on the outfile construct in a few places but it seems that this only writes the fi

5条回答
  •  心在旅途
    2021-02-01 02:17

    You could try executing the query from the your local cli and redirect the output to a local file destination;

    mysql -user -pass -e"select cols from table where cols not null" > /tmp/output
    

提交回复
热议问题