How to export a MySQL database to JSON?

后端 未结 15 1864
感动是毒
感动是毒 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条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-04 18:21

    Using MySQL Shell you can out put directly to JSON using only terminal

    echo "Your SQL query" | mysqlsh --sql --result-format=json --uri=[username]@localhost/[schema_name]
    

提交回复
热议问题