Bug #55737 [Com]: LOAD DATA LOCAL INFILE - The used command is not allowed with this MySQL versio
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 Links0 Client API version mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $ Directive Local Value Master Value mysql.allow_local_infileOn On mysql.allow_persistent Off Off mysql.connect_timeout 60 60 mysql.default_host no valueno value mysql.default_password no valueno value mysql.default_port no valueno value mysql.default_socketno valueno value mysql.default_user no valueno value mysql.max_links Unlimited Unlimited mysql.max_persistentUnlimited Unlimited mysql.trace_modeOff 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 Links0 Directive Local Value Master Value mysqli.allow_local_infile On On mysqli.allow_persistent On On mysqli.default_host no valueno value mysqli.default_port 33063306 mysqli.default_pw no valueno value mysqli.default_socket no valueno value mysqli.default_user no valueno value mysqli.max_linksUnlimited Unlimited mysqli.max_persistent Unlimited Unlimited mysqli.reconnectOff Off mysqlnd mysqlnd enabled Version mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $ Compression supported SSL supported Command buffer size 4096 Read buffer size32768 Read timeout31536000 Collecting statistics Yes Collecting memory statisticsNo 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 '' LINES STARTING BY '' TERMINATED BY '' 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
Bug #54158 [Com]: MYSQLND + PDO MySQL requires #define MYSQL_OPT_LOCAL_INFILE
Edit report at https://bugs.php.net/bug.php?id=54158&edit=1 ID: 54158 Comment by: richardpq at gmail dot com Reported by:tamas at ideaweb dot hu Summary:MYSQLND + PDO MySQL requires #define MYSQL_OPT_LOCAL_INFILE Status: Closed Type: Bug Package:PDO related Operating System: Linux PHP Version:5.3.5 Assigned To:mysql Block user comment: N Private report: N New Comment: I don't get it, after 5.3.6 release was working? because I have 5.3.8 and it is no working https://bugs.php.net/bug.php?id=55737 Previous Comments: [2011-09-09 07:03:01] and...@php.net This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. [2011-09-02 13:53:30] and...@php.net Automatic comment from SVN on behalf of andrey Revision: http://svn.php.net/viewvc/?view=revision&revision=316039 Log: Fix for Bug #54158 MYSQLND + PDO MySQL requires #define MYSQL_OPT_LOCAL_INFILE and a bunch of other small preprocessor fixes [2011-04-03 03:57:48] anthon dot pang at gmail dot com Sorry, you're right. My "workaround" is actually because MySQL is compiled with --enable-local-infile. [2011-04-03 01:08:09] anthon dot pang at gmail dot com As a workaround, I use PDO::ATTR_EMULATE_PREPARES. With 5.2.17 and 5.3.6 (using mysqlndb), both LOAD DATA INFILE and LOAD DATA LOCAL INFILE work on my Ubuntu 10.04 box, using PDO_MYSQL and MYSQLI extensions. [2011-03-04 10:21:43] and...@php.net to be fixed after 5.3.6 is released The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=54158 -- Edit this bug report at https://bugs.php.net/bug.php?id=54158&edit=1
Bug #55737 [Com]: LOAD DATA LOCAL INFILE - The used command is not allowed with this MySQL versio
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: Feedback Type: Bug Package:MySQL related Operating System: opensuse 11.0 PHP Version:5.3.8 Assigned To:mysql Block user comment: N Private report: N New Comment: No, I dont have enable, my php.ini: ; open_basedir, if set, limits all file operations to the defined directory ; and below. This directive makes most sense if used in a per-directory ; or per-virtualhost web server configuration file. This directive is ; *NOT* affected by whether Safe Mode is turned On or Off. ; http://php.net/open-basedir ;open_basedir = Also has the first guy said... I can use LOAD DATA LOCAL INFILE, from MySql client but not from an application using PHP. Previous Comments: [2011-10-18 20:23:34] and...@php.net mysqlnd allows LOAD DATA LOCAL in all cases but if open_basedir is enabled. If open_basedir is set it is disabled regardless where the file to be loaded resides. This might be too strict for shared envs. Do you have open_basedir enabled? [2011-10-18 16:27:34] denis_truffaut at hotmail dot com Related bugs : https://bugs.php.net/bug.php?id=46964 https://bugs.php.net/bug.php?id=54158 A PHP Dev said it was resolved in 5.3.6, but it came back. As it is a very common usage of MySQL, especialy to save/import data, it had to be fixed in priority. The override PDO::MYSQL_ATTR_LOCAL_INFILE => 1 also doesn't not work. What to do ?! :O [2011-10-03 21:08:08] richardpq at gmail dot com 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? [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 Links0 Client API version mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $ Directive Local Value Master Value mysql.allow_local_infileOn On mysql.allow_persistent Off Off mysql.connect_timeout 60 60 mysql.default_host no valueno value mysql.default_password no valueno value mysql.default_port no valueno value mysql.default_socketno valueno value mysql.default_user no valueno value mysql.max_links Unlimited Unlimited mysql.max_persistentUnlimited Unlimited mysql.trace_modeOff 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 Links0 Directive Local Value Master Value mysqli.allow_local_infile On On mysqli.allow_persistent On On mysqli.default_host no valueno value mysqli.default_port 33063306 mysqli.default_pw no valueno value mysqli.default_socket no valueno value mysqli.default_user no valueno value mysqli.max_linksUnlimited Unlimited mysqli.max_persistent Unlimited Unlimited mysqli.reconnectOff Off mysqlnd mysqlnd enabled Version mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $ Compression supported SSL supported Command buffer size 4096 Read buffer size32768 Read timeout31536000 Collecting statistics Yes Coll
Bug #55737 [Com]: LOAD DATA LOCAL INFILE - The used command is not allowed with this MySQL versio
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: Assigned Type: Bug Package:MySQL related Operating System: opensuse 11.0 PHP Version:5.3.8 Assigned To:mysql Block user comment: N Private report: N New Comment: "Some bug fix is planned for PHP 5.4", what is that mean? no solution for php 5.3? I would prefer a solution for this version, rather than wait for the final release of the new version, testing and see if it not affect others thing. Previous Comments: [2011-10-20 13:07:17] stefan dot kaifer at hartmann dot info Thanx, it's very good! [2011-10-20 12:57:34] denis_truffaut at hotmail dot com Some bug fix is planned for PHP 5.4 : http://php.net/releases/NEWS_5_4_0_beta1.txt - PDO MySQL driver: . Fixed bug #54158 (MYSQLND+PDO MySQL requires #define MYSQL_OPT_LOCAL_INFILE) (Andrey) [2011-10-19 02:30:15] richardpq at gmail dot com No, I dont have enable, my php.ini: ; open_basedir, if set, limits all file operations to the defined directory ; and below. This directive makes most sense if used in a per-directory ; or per-virtualhost web server configuration file. This directive is ; *NOT* affected by whether Safe Mode is turned On or Off. ; http://php.net/open-basedir ;open_basedir = Also has the first guy said... I can use LOAD DATA LOCAL INFILE, from MySql client but not from an application using PHP. [2011-10-18 20:23:34] and...@php.net mysqlnd allows LOAD DATA LOCAL in all cases but if open_basedir is enabled. If open_basedir is set it is disabled regardless where the file to be loaded resides. This might be too strict for shared envs. Do you have open_basedir enabled? [2011-10-18 16:27:34] denis_truffaut at hotmail dot com Related bugs : https://bugs.php.net/bug.php?id=46964 https://bugs.php.net/bug.php?id=54158 A PHP Dev said it was resolved in 5.3.6, but it came back. As it is a very common usage of MySQL, especialy to save/import data, it had to be fixed in priority. The override PDO::MYSQL_ATTR_LOCAL_INFILE => 1 also doesn't not work. What to do ?! :O The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=55737 -- Edit this bug report at https://bugs.php.net/bug.php?id=55737&edit=1
Bug #55737 [Com]: LOAD DATA LOCAL INFILE - The used command is not allowed with this MySQL versio
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: Feedback Type: Bug Package:MySQL related Operating System: opensuse 11.0 PHP Version:5.3.8 Assigned To:mysql Block user comment: N Private report: N New Comment: and...@php.net, Neither 5.3snv and 5.3.8 snv work, the same problem Previous Comments: [2011-10-21 11:20:24] and...@php.net Can you try 5.3-svn? Altough the NEWS entry mentions 5.4 the fix has landed in 5.3 too (committed on Sep 2). 5.3.8 was released on Aug 23rd. [2011-10-20 13:29:11] richardpq at gmail dot com "Some bug fix is planned for PHP 5.4", what is that mean? no solution for php 5.3? I would prefer a solution for this version, rather than wait for the final release of the new version, testing and see if it not affect others thing. [2011-10-20 13:07:17] stefan dot kaifer at hartmann dot info Thanx, it's very good! [2011-10-20 12:57:34] denis_truffaut at hotmail dot com Some bug fix is planned for PHP 5.4 : http://php.net/releases/NEWS_5_4_0_beta1.txt - PDO MySQL driver: . Fixed bug #54158 (MYSQLND+PDO MySQL requires #define MYSQL_OPT_LOCAL_INFILE) (Andrey) [2011-10-19 02:30:15] richardpq at gmail dot com No, I dont have enable, my php.ini: ; open_basedir, if set, limits all file operations to the defined directory ; and below. This directive makes most sense if used in a per-directory ; or per-virtualhost web server configuration file. This directive is ; *NOT* affected by whether Safe Mode is turned On or Off. ; http://php.net/open-basedir ;open_basedir = Also has the first guy said... I can use LOAD DATA LOCAL INFILE, from MySql client but not from an application using PHP. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=55737 -- Edit this bug report at https://bugs.php.net/bug.php?id=55737&edit=1
Bug #55737 [Com]: LOAD DATA LOCAL INFILE - The used command is not allowed with this MySQL versio
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: Feedback Type: Bug Package:MySQL related Operating System: opensuse 11.0 PHP Version:5.3.8 Assigned To:mysql Block user comment: N Private report: N New Comment: I haven't test this functionality before, this is the first time that I tested it. @Stefan point that it was working before and now not, but I don't know which version he use... At the moment I am testing locally so I can put the files in my mysql data directory and it works, but I don't know, what I will do when I have to upload to the server since is not a private server. Previous Comments: [2011-10-25 18:53:41] and...@php.net Which is the last version of 5.3 which worked for you? [2011-10-25 18:36:30] richardpq at gmail dot com and...@php.net, Neither 5.3snv and 5.3.8 snv work, the same problem [2011-10-21 11:20:24] and...@php.net Can you try 5.3-svn? Altough the NEWS entry mentions 5.4 the fix has landed in 5.3 too (committed on Sep 2). 5.3.8 was released on Aug 23rd. [2011-10-20 13:29:11] richardpq at gmail dot com "Some bug fix is planned for PHP 5.4", what is that mean? no solution for php 5.3? I would prefer a solution for this version, rather than wait for the final release of the new version, testing and see if it not affect others thing. [2011-10-20 13:07:17] stefan dot kaifer at hartmann dot info Thanx, it's very good! The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=55737 -- Edit this bug report at https://bugs.php.net/bug.php?id=55737&edit=1