开发者

mysql to csv without using INTO OUTFILE of mysql

I need to export data from mysql to a csv file with column heading but i dont have file permission on the server. Is there any otherway t开发者_开发知识库o do it? i.e. using php fwrite? or fputcsv?

Any help will be much appriciate.

Thanks.


If you can connect to the MySQL server, you can run the mysqldump utility, which is capable of generating CSV files. This is far easier than trying to come up with something yourself.

mysqldump --tab --fields-terminated-by="," --host=$SERVER --user=$USERNAME --password=$PASSWORD $DATABASE
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜