mysql导出数据不输出标题行
当想使用数据库中的某些数据,想将其导入到文件中,而想去掉第一行的标题是可以加上-N参数
如通过下面命令导出数据:
mysql -uuserName -ppasswd -hhost -Pport -Ddatabase -e " select * from tableName" > exportResult.txt
结果为:
studentid studentname
1 denny
2 candy
3 noboy
...
如下不想要第1行,即studentid studentname这个表示字段的标题行,可以通过如下方式导出:
mysql -N -uuserName -ppasswd -hhost -Pport -Ddatabase -e " select * from tableName" > exportResult.txt
加一个-N参数即达到目的
猜你喜欢
转载自daizj.iteye.com/blog/2175705
今日推荐
周排行