in reply to mysql remote server query

I am making a mysql query to a remote host and after many many hours of failure have learned a query containing "to outfile" means save the file on the remote server not the local host.

Make the query from the local host, not from a session on the remote host

Replies are listed 'Best First'.
Re^2: mysql remote server query
by terry1738 (Initiate) on Feb 01, 2010 at 02:53 UTC
    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