--local-infile: mysql cmd line args from Perl?

--local-infile: mysql cmd line args from Perl?

am 20.06.2002 20:02:34 von Tom Atwater

Hello,

I am having the problem detailed below.

The solution according to Monty is to
invoke mysql from the cmd line with the --local-infile option.

Anyone know how I can enable this if instead
connecting to the database through a Perl script?

I don't see anything in perldoc DBD::mysql about
passing cmd line arguments .

Note that I do start the mysqld daemon with this argument
already -- that doesn't help.

I also tried substituting "dbi:mysql --local-infile:"
for "dbi:mysql:" in the 1st arg to DBI->connect(),
but that didn't work.

Tom

--- Tom Atwater wrote:
> Date: Tue, 18 Jun 2002 14:39:15 -0700 (PDT)
> From: Tom Atwater
> Subject: Re: LOAD DATA LOCAL INFILE in Alpha 3.23.49]
> To: mysql@lists.mysql.com
>
>
> Hello,
>
> Below is a thread from March.
>
> Basically, I am having the same problem in
> v3.23.49 (release version, not Alpha).
> I also have Linux RedHat 7.2, same as Tom.
> I compiled MySQL from source using gcc v2.96 .
>
> Here are the details of my problem:
>
> The SQL command
>
> LOAD DATA LOCAL INFILE '/home/toma/spotplay/EVD0619.EG' REPLACE INTO TABLE
> `TSN` FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
>
> works fine from a phpMyAdmin web page;
> however, the exact same command inside a
> Perl script on the same machine localhost fails
> with the message
>
> DBD::mysql::st execute failed: The used command is not allowed with this
> MySQL version at /home/toma/lib/perl5/Database/MySql.pm line 61.
> Can't execute SQL statement:
> The used command is not allowed with this MySQL version
>
> I assume this discrepancy means that phpMyAdmin is
> using the server, while the Perl script is a client.
>
>
> I have tried all of the following
> -- using local-infile in my.cnf as Sinisa suggests
> -- rerunning./configure with arg --enable-local-infile, then recompiling
> -- restarting safe_mysqld with --local-infile=1
>
> I have also looked at the suggested fixes in
> "Security issues with LOAD DATA LOCAL" in the MySQL
> documentation at
> http://www.mysql.com/doc/L/O/LOAD_DATA_LOCAL.html
> which says among other things
> > By default, all MySQL clients and libraries are compiled
> > with --enable-local-infile, to be compatible with
> > MySQL 3.23.48 and before.
>
> If that is true, and I didn't change the default
> the first time I compiled it, then using --local-infile=1
> when starting safe_mysqld should enable LOAD DATA
> LOCAL INFILE, the way I read it.
> In any case after recompiling it should enable it.
>
> The web page also says
> > If you don't configure MySQL with --enable-local-infile,
> > then LOAD DATA LOCAL will be disabled by all clients,
> > unless one calls mysql_options(... MYSQL_OPT_LOCAL_INFILE, 0)
> > in the client. See section 8.4.3.159 mysql_options().
>
> That's a C function. Any way to call this from Perl?
>
> Michael Widenius wrote:
> > > Did you give the above option to both 'mysqld' and 'mysql' ?
>
> How do I do it for mysql from inside a Perl script?
> Can you pass args through Perl DBI calls to this end,
> does anyone know?
> Or am I missing something more obvious?
>
> Tom
>
>
>
>
> Date: Mon, 04 Mar 2002 15:27:58 -0500
>
> From: "Thomas Birchmire"
>
> To: monty@mysql.com, sinisa@mysql.com, rob@fatkat.com
>
> Subject: Re: LOAD DATA LOCAL INFILE in Alpha 3.23.49]
>
> CC: mysql@lists.mysql.com
>
>
> I have the same problem using Linux RedHat 7.2. Just what do I have to
> configure my binary MySQL : Ver 8.23 Distrib 3.23.49a, for pc-linux-gnu on
> i686?
> The rest of MySQL works as it should.
> Regards Tom Birchmire
>
>
> Michael Widenius wrote:
> > > Hi!
> > > >>>>> "Sinisa" == Sinisa Milivojevic writes:
> > > Sinisa> rob@fatkat.com writes:
> > >> >Description:
> > >> LOAD DATA LOCAL INFILE ...
> > >> > >> leads to 'The used command is not allowed with this MySQL version'
> > >> > >> This happens regardless of whether I have a
> > >> > >> local-infile = 1
> > >> > >> in my /etc/my.cnf. In neither case does the local-infile variable
> show
> > >> up with SHOW VARIABLES.
> > > We don't have a status variable that shows if this feature is enabled
> > or not.
> > > The above is quite strange as I did test this properly before doing a
> > release.
> > > Did you give the above option to both 'mysqld' and 'mysql' ?
> > > Which MySQL distribution are you using ?
> > > Sinisa> Hi!
> > > Sinisa> A new startup variable :
> > > Sinisa> --local-infile
> > > Sinisa> must be used to enable the above feature.
> > > That is what the user described that he did do...
> > > Regards,
> > Monty
> > > ------------------------------------------------------------ ---------
> > Before posting, please check:
> > http://www.mysql.com/manual.php (the manual)
> > http://lists.mysql.com/ (the list archive)
> > > To request this thread, e-mail
> > To unsubscribe, e-mail
>
> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> >
>
> Attachment: Forwarded Message
>
> From: "Sinisa Milivojevic"
>
> Date: Tue, 5 Mar 2002 14:43:23 +0200
>
> To: tbirchmire@usa.net
>
> CC: monty@mysql.com, rob@fatkat.com, mysql@lists.mysql.com
>
> Subject: Re: LOAD DATA LOCAL INFILE in Alpha 3.23.49]
>
>
> Thomas Birchmire writes:
> > I have the same problem using Linux RedHat 7.2. Just what do I have to
> > configure my binary MySQL : Ver 8.23 Distrib 3.23.49a, for pc-linux-gnu on
> > i686?
> > The rest of MySQL works as it should.
> > Regards Tom Birchmire
> > > loca-infile is not a variable.
>
> Therefore, you either start a server with --local-infile or have in
> your /etc/my.cnf :
>
> [mysqld]
> local-infile
>
> --
> Regards,
> __ ___ ___ ____ __
> / |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic
> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
> /_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
> <___/ www.mysql.com
>
>
>
>
> =====
> Tom Atwater
> tomath2o.yahoo.com
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com
>
> ------------------------------------------------------------ ---------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail
> To unsubscribe, e-mail
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>



=====
Tom Atwater
tomath2o.yahoo.com

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1830@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.