Ubuntu 12.04上的MySQL LOCAL_INFILE仍然被禁用

时间:2013-02-21 09:27:59

标签: mysqli ubuntu-12.04

在Ubuntu 12.04 64bit LTS上,包括MySQL版本5.5.29 - 我在mysql中尝试了一个LOAD DATA LOCAL INFILE命令,但它失败了

DB Error (1148) The used command is not allowed with this MySQL version

我做了以下事情:

local-infile=1添加到/etc/mysql/my.cnf文件的 [mysql] [mysqld] 部分,然后重新启动mysql服务;

在我的mysqli启动中添加了行选项MYSQLI_OPT_LOCAL_INFILE,TRUE:

function dbConnect($dbHost, $dbUser, $dbPass, $dbName) {
    $mysqli = new mysqli($dbHost, $dbUser, $dbPass, $dbName);
    $mysqli->options(MYSQLI_OPT_LOCAL_INFILE,TRUE);
    if ($mysqli->connect_error)
        die('DB Connect Error (' . $mysqli->connect_errno . ') '. $mysqli->connect_error);
    return $mysqli;
}

但我仍然收到错误?也许在这个mysql版本中没有编译Local-infile选项?

0 个答案:

没有答案