Please excuse my previous inept attempt at explaining what I want.

I am able to log on to the remote database and I can do anything I want on that database so I dont need any help in the logging on process.

When I logged on to the remote mysql server I tried using the mysql statement "into outfile '/tmp/Sep' fields terminated by ','" but that only saves the csv file on the remote host not the local host.

The solution is to use perl to take the mysql query that I get from the remote mysql server and put that data into a csv file on the local mysql client.

In short I require a perl script that takes the result of a mysql query and puts it into a csv file WITHOUT using the mysql statement "into outfile".

I have checked the monastry wings without any luck I guess because the mysql statement "into outfile" is used 99% of the time there is no need for such a script but it cannot be used in this situation.

Mysqldump is not suitable, I don't want to import the whole database everytime I want to make a simple query on it

In reply to mysql remote server query by terry1738

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.