From:             
Operating system: opensuse 11.0
PHP version:      5.3.8
Package:          MySQL related
Bug Type:         Bug
Bug description:LOAD DATA LOCAL INFILE - The used command is not allowed with 
this MySQL versio

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 bug report at https://bugs.php.net/bug.php?id=55737&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=55737&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=55737&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=55737&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=55737&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=55737&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=55737&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=55737&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=55737&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=55737&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=55737&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=55737&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=55737&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=55737&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=55737&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=55737&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=55737&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=55737&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=55737&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=55737&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=55737&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=55737&r=mysqlcfg

Reply via email to