Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 584 Vote(s) - 3.54 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I output MySQL query results in CSV format?

#21
If you have PHP set up on the server, you can use [mysql2csv][1] to export an (actually valid) CSV file for an arbitrary MySQL query. See [my answer at MySQL - SELECT * INTO OUTFILE LOCAL ?][2] for a little more context/info.

I tried to maintain the option names from `mysql` so it should be sufficient to provide the `--file` and `--query` options:

./mysql2csv --file="/tmp/result.csv" --query='SELECT 1 as foo, 2 as bar;' --user="username" --password="password"

__"Install" `mysql2csv` via__

wget

[To see links please register here]

-O mysql2csv -q && (sha256sum mysql2csv | cmp <(echo "b109535b29733bd596ecc8608e008732e617e97906f119c66dd7cf6ab2865a65 mysql2csv") || (echo "ERROR comparing hash, Found:" ;sha256sum mysql2csv) ) && chmod +x mysql2csv

(Download content of the gist, check checksum and make it executable.)

[1]:
[2]:

[To see links please register here]




Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through