Bug #68077 [Opn->Csd]: LOAD DATA LOCAL INFILE / open_basedir restriction

From: Date: Mon, 16 Nov 2015 09:02:26 +0000
Subject: Bug #68077 [Opn->Csd]: LOAD DATA LOCAL INFILE / open_basedir restriction
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-197278@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68077&edit=1 ID: 68077 Updated by: laruence@php.net Reported by: benoit dot chenu at gmail dot com Summary: LOAD DATA LOCAL INFILE / open_basedir restriction -Status: Open +Status: Closed Type: Bug Package: PDO MySQL Operating System: Linux / Red Hat 5.10 PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Automatic comment on behalf of laruence@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=be6fd4ba89e151b68ddd68e53d6a403c2e8eb862 Log: Fixed bug #68077 (LOAD DATA LOCAL INFILE / open_basedir restriction) Previous Comments: ------------------------------------------------------------------------ [2015-02-03 20:13:36] phpbugs2012 at joern dot heissler dot de Duplicate of https://bugs.php.net/bug.php?id=62889 ------------------------------------------------------------------------ [2014-09-22 19:02:37] benoit dot chenu at gmail dot com Description: ------------ When open_basedir is set (to whatever, / for exemple), we've can't send a "LOAD DATA LOCAL INFILE" sql command and got this error : SQLSTATE[42000]: Syntax error or access violation: 1148 The used command is not allowed with this MySQL version If the open_basedir directive is not set, the command works fine. If we can't use open_basedir directive with this sql command (for security reasons), please update documentation. Test script: --------------- try { $pdo = new \PDO('mysql:host=127.0.0.1;dbname=test','test','test', array( \PDO::MYSQL_ATTR_LOCAL_INFILE => true, \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION )); $pdo->query("LOAD DATA LOCAL INFILE '/tmp/test.csv' INTO TABLE test_table"); } catch(Exception $e) { echo $e->getMessage()."\n"; } Actual result: -------------- SQLSTATE[42000]: Syntax error or access violation: 1148 The used command is not allowed with this MySQL version ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68077&edit=1

« previous php.bugs (#197278) next »