在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选项?