Bug #68077 [NEW]: LOAD DATA LOCAL INFILE / open_basedir restriction
| From: | benoit dot chenu at gmail dot com | Date: | Mon, 22 Sep 2014 19:02:38 +0000 |
| Subject: | Bug #68077 [NEW]: LOAD DATA LOCAL INFILE / open_basedir restriction | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-187664@lists.php.net to get a copy of this message | ||
From: benoit dot chenu at gmail dot com
Operating system: Linux / Red Hat 5.10
PHP version: Irrelevant
Package: PDO MySQL
Bug Type: Bug
Bug description:LOAD DATA LOCAL INFILE / open_basedir restriction
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 bug report at https://bugs.php.net/bug.php?id=68077&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68077&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68077&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68077&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68077&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68077&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68077&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68077&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68077&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68077&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68077&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68077&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68077&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68077&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68077&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68077&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68077&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68077&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68077&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68077&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68077&r=mysqlcfg