How to export a mysql CLI query into a csv file


if you are trying to export your query into a csv file to share it or just analyze any data, you can perform the following CLI command:

Hope it helps.

Enjoy!