![]() |
SQL to CSV; simple question?
I have an SQL database running on a remote host (I don't know how I would access files saved to that machine).
How do I save (or get) the query output to a CSV file? |
If the remote machine allows client connections you could login with (at least with mysql):
Code:
mysql --host=xxx.xxx.xxx.xxx --user=dbaselogin --password=mypasswordTry: Code:
SELECT order_id,product_name,qtyCopied from http://www.tech-recipes.com/rx/1475/...t-or-csv-file/ Regards, Stefan |
I couldn't write using the output command. If I had I don't know how I would have gotten the file.
Instead I just used redirects: Code:
mysql --host=xxx.xxx.xxx.xxx --user=dbaselogin --password=mypassword < mysqlscript.sql > myoutputfile.csv |
| All times are GMT -5. The time now is 01:34 PM. |