Bug #68077 [Com]: LOAD DATA LOCAL INFILE / open_basedir restriction

From: Date: Tue, 03 Feb 2015 20:13:36 +0000
Subject: Bug #68077 [Com]: LOAD DATA LOCAL INFILE / open_basedir restriction
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190450@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 Comment by: phpbugs2012 at joern dot heissler dot de Reported by: benoit dot chenu at gmail dot com Summary: LOAD DATA LOCAL INFILE / open_basedir restriction Status: Open Type: Bug Package: PDO MySQL Operating System: Linux / Red Hat 5.10 PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Duplicate of https://bugs.php.net/bug.php?id=62889 Previous Comments: ------------------------------------------------------------------------ [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 (#190450) next »