ID:               21356
 Comment by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Open
 Bug Type:         MySQL related
 Operating System: Slackware
 PHP Version:      4.3.0
 New Comment:

"BASE" microarray software requires this function.  On gentoo I had to
build mysql first after adding the flag, then rebuild php to get the
functionality included.


Previous Comments:
------------------------------------------------------------------------

[2003-01-02 17:53:01] [EMAIL PROTECTED]

Didn't try that specifically, but the problem does not exist if I use
mysql from the command line.

I 'solved' this for my immediate situation by removing the 'if' around
the infile check in ext/mysql/libmysql/libmysql.c

Here (line 1025?):
/*
  Only enable LOAD DATA INFILE by default if configured with
  --with-enabled-local-inflile
*/
#ifdef ENABLED_LOCAL_INFILE
  mysql->options.client_flag|= CLIENT_LOCAL_FILES;
#endif
  return mysql;

is now:
/*
  Only enable LOAD DATA INFILE by default if configured with
  --with-enabled-local-inflile
*/
  mysql->options.client_flag|= CLIENT_LOCAL_FILES;
  return mysql;

recompiled everything and it works.

I'd tried to recompile PHP with '--with-enabled-local-inflile' (and the
properly spelled '--with-enabled-local-infile') and neither worked. 
The only thing that worked was removing the IF stuff in the .c file.

------------------------------------------------------------------------

[2003-01-02 17:26:10] [EMAIL PROTECTED]

Does the problem go away if you tell PHP to use your MySQL's headers
rather then the ones bundled with PHP?

------------------------------------------------------------------------

[2003-01-02 16:46:14] [EMAIL PROTECTED]

PHP 4.2.1 and MySQL system set up allowed users using the phpMyAdmin
system to use the LOAD DATA INFILE functionality.  ONLY thing changed
was upgrading to PHP 4.3, and now that functionality produces the error
'The used command is not allowed with this MySQL version'.  Seeing as
how no other software changed, this seems to point to the bundled PHP
MySQL client (which we're using) to not enabling the
'--enable-local-infile' flag.
===================
>From the MySQL manual:
By default, all MySQL clients and libraries are compiled with
--enable-local-infile, to be compatible with MySQL 3.23.48 and before.

One can disable all LOAD DATA LOCAL commands in the MySQL server by
starting mysqld with --local-infile=0.

In the case that LOAD DATA LOCAL INFILE is disabled in the server or
the client, you will get the error message (1148):

The used command is not allowed with this MySQL version
====================
Since we're using the --local-infile=1 to start the MySQL daemon, that
points to the PHP 4.3 bundled client library being the culprit.

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=21356&edit=1

Reply via email to