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 <[EMAIL PROTECTED]> 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
<http://us.i1.yimg.com/us.yimg.com/i/space.gif>
From: "Thomas Birchmire" <[EMAIL PROTECTED]>
<http://us.i1.yimg.com/us.yimg.com/i/space.gif>
To: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]
<http://us.i1.yimg.com/us.yimg.com/i/space.gif>
Subject: Re: LOAD DATA LOCAL INFILE in Alpha 3.23.49]
<http://us.i1.yimg.com/us.yimg.com/i/space.gif>
CC: [EMAIL PROTECTED]
<http://us.i1.yimg.com/us.yimg.com/i/space.gif>

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 advertised. 
  Regards Tom Birchmire


Michael Widenius <[EMAIL PROTECTED]> wrote:
> > Hi!
> > >>>>> "Sinisa" == Sinisa Milivojevic <[EMAIL PROTECTED]> writes:
> > Sinisa> [EMAIL PROTECTED] 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 <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 

Attachment: Forwarded Message

From: "Sinisa Milivojevic" <[EMAIL PROTECTED]>
<http://us.i1.yimg.com/us.yimg.com/i/space.gif>
Date: Tue, 5 Mar 2002 14:43:23 +0200
<http://us.i1.yimg.com/us.yimg.com/i/space.gif>
To: [EMAIL PROTECTED]
<http://us.i1.yimg.com/us.yimg.com/i/space.gif>
CC: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]
<http://us.i1.yimg.com/us.yimg.com/i/space.gif>
Subject: Re: LOAD DATA LOCAL INFILE in Alpha 3.23.49]
<http://us.i1.yimg.com/us.yimg.com/i/space.gif>

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 advertised. 
> 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 <[EMAIL PROTECTED]>
/ /|_/ / // /\ \/ /_/ / /__   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 <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to