Edit report at https://bugs.php.net/bug.php?id=55737&edit=1

 ID:                 55737
 Comment by:         richardpq at gmail dot com
 Reported by:        stefan dot kaifer at hartmann dot info
 Summary:            LOAD DATA LOCAL INFILE - The used command is not
                     allowed with this MySQL versio
 Status:             Open
 Type:               Bug
 Package:            MySQL related
 Operating System:   opensuse 11.0
 PHP Version:        5.3.8
 Block user comment: N
 Private report:     N

 New Comment:

Hi I have exact the same problem, like you I compile php using those options, I 
have the same php version and mysql 5.5.15, have you resolve the problem?


Previous Comments:
------------------------------------------------------------------------
[2011-09-20 09:49:56] stefan dot kaifer at hartmann dot info

Description:
------------
Hello

I've compiled php myself with this command:

./configure --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd 
....

Now my php-applications can't use 
"LOAD DATA LOCAL INFILE '/tmp/import-20110919173927-78613.txt' INTO TABLE ..." 
anymore!

On the command prompt I can use "LOAD DATA LOCAL INFILE", that means mysql 
server allows me to use "LOAD DATA LOCAL INFILE", the server variable "local 
infile" is setted to "ON" (with "local-infile=1" in the my.cnf).

It seems a php-mysqlnd problem. Neither the mysql nor the mysqli extensions 
allows me to use "LOAD DATA LOCAL INFILE". This is the Connect-line in my code:

$Connect = mysql_connect($DB_Host .":".$DB_Port,$DB_User,$DB_Password, FALSE, 
128);

The error is:
#1148 - The used command is not allowed with this MySQL version 

Mysql-server: 5.5.16
PHP: 5.3.8
PHP-MYSQL-client: mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $
PHPINFO:

mysql
MySQL Support   enabled
Active Persistent Links         0
Active Links    0
Client API version      mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $

Directive       Local Value     Master Value
mysql.allow_local_infile        On      On
mysql.allow_persistent  Off     Off
mysql.connect_timeout   60      60
mysql.default_host      no value        no value
mysql.default_password  no value        no value
mysql.default_port      no value        no value
mysql.default_socket    no value        no value
mysql.default_user      no value        no value
mysql.max_links Unlimited       Unlimited
mysql.max_persistent    Unlimited       Unlimited
mysql.trace_mode        Off     Off

mysqli
MysqlI Support  enabled
Client API library version      mysqlnd 5.0.8-dev - 20102224 - $Revision: 
310735 $
Active Persistent Links         0
Inactive Persistent Links       0
Active Links    0

Directive       Local Value     Master Value
mysqli.allow_local_infile       On      On
mysqli.allow_persistent On      On
mysqli.default_host     no value        no value
mysqli.default_port     3306    3306
mysqli.default_pw       no value        no value
mysqli.default_socket   no value        no value
mysqli.default_user     no value        no value
mysqli.max_links        Unlimited       Unlimited
mysqli.max_persistent   Unlimited       Unlimited
mysqli.reconnect        Off     Off

mysqlnd
mysqlnd enabled
Version         mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $
Compression     supported
SSL     supported
Command buffer size     4096
Read buffer size        32768
Read timeout    31536000
Collecting statistics   Yes
Collecting memory statistics    No
Tracing         n/a 

I hope, that somebody can help.

Best regards

Stefan

Test script:
---------------
$Connect = mysql_connect($DB_Host .":".$DB_Port,$DB_User,$DB_Password, FALSE, 
128);
$StrSQL = "LOAD DATA LOCAL INFILE '/tmp/test.txt' INTO TABLE testtable 
          FIELDS TERMINATED BY '</td><td>' LINES
          STARTING BY '<tr><td>'
          TERMINATED BY '</td></tr>' 
          IGNORE 1 LINES .....";
$Result1 = mysql_db_query($DB,$StrSQL,$Connect);



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



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

Reply via email to