How to store MySQL results to a file in table format

不打扰是莪最后的温柔 提交于 2019-11-30 19:50:26
GreyBeardedGeek

This should do the trick:

mysql -u root -p -t -vvv < select.sql | sed '1 d' > output.txt
Jeff Vanrykel

You can also do following:

mysql -uroot -p DatabaseName -t -e "select * from table" > file.txt

This doesn't need to make an SQL file and then filter out the first line.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!