开发者

mysqldump option to include column names in first row

I'm using mysqldump to dump all my tables to 开发者_C百科CSV files like so:

mysqldump -u -p -t -TC:\Temp --fields-terminated-by=,

Is there an option to have mysqldump include the column names in the first row of each file?


As of MySQL 5.5 (perhaps before) you can now use --complete-insert or -c to achieve this.


There is not; you'll have to do that yourself.


mysql test -e"select * from users" | tr '\t' ',' > tocsv.csv

This may not be exact but very close to what you are trying to.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜