How to export a MySQL database to JSON?

后端 未结 15 1816
感动是毒
感动是毒 2020-12-04 17:52

I am interested in exporting a subset of values from a MySQL database into a JSON-formatted file on disk.

I found a link that talks about a possible way to do this:

15条回答
  •  Happy的楠姐
    2020-12-04 18:06

    as described in the link, it only returns (as I mentioned) 15 results. (fwiw, I checked these results against the 4000 I'm supposed to get, and these 15 are the same as the first 15 of the 4000)

    That's because mysql restricts the length of the data returned by group concat to the value set in @@group_concat_max_len as soon as it gets to the that amount it truncates and returns what it's gotten so far.

    You can set @@group_concat_max_len in a few different ways. reference The mysql documentation...

提交回复
热议问题