It is not necessary to spell out the recipes for compiling the individual C source files, because make can figure them out: it has an implicit rule for updating a ‘.o’ file from a correspondingly named ‘.c’ file using a ‘cc -c’ command. For example, it will use the recipe ‘cc -c main.c -o main.o’...
期望 MySQL 直接从查询中生成格式良好的 json 可能对 MySQL 提出了太多要求。相反,请考虑生成更方便的内容,例如 CSV(使用您已经知道的 INTO OUTFILE '/path/to/output.csv' FIELDS TERMINATED BY ',' 代码段),然后将结果转换为内置支持它的语言中的 json,例如 python 或 php。