Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,
i am planning to upload bulk file from windows to my MySQL server,which is present in Linux server.
is it possible to upload my file using Net::MySQL module from windows or do i need to copy this file to server and run this command load command
below is my code
use strict; use Net::Mysql; my $mysql = Net::MySQL->new( hostname => 'linuxserver', database => 'ADMIN', user => 'user', password => 'password' ); $mysql->query(qq{LOAD DATA LOCAL INFILE 'C:\\1.csv' INTO TABLE `ADMIN` +.`temp` FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n' }); if ($mysql->is_error) { my $DBError = $mysql->get_error_message; print "MySQL Error : $DBError \n"; } $mysql->close;

Replies are listed 'Best First'.
Re: Net::MySQL will work load data local in file command
by wfsp (Abbot) on Jul 27, 2009 at 16:07 UTC
    ...or do i need to copy this file to server...
    That's the way I would do it. How would the server know about C:\1.csv?
Re: Net::MySQL will work load data local in file command
by psini (Deacon) on Jul 27, 2009 at 17:14 UTC

    Do you really believe that asking again the same question will give you better answers?

    Rule One: "Do not act incautiously when confronting a little bald wrinkly smiling man."