加载本地infile不允许perl mysql

前端之家收集整理的这篇文章主要介绍了加载本地infile不允许perl mysql前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
谁知道如何在Ubuntu上的最新 MySQL中打开加载本地infile设置?我编辑了/etc/MysqL/my.cnf文件添加

local-infile=1

并在Perl代码

dbConnectString=dbi:MysqL:orthomcl:MysqLlocalinfile=1

但仍然得到

DBD::MysqL::st execute Failed: The used command is not allowed with this MysqL version...

它由名为OrthoMCL的应用程序使用

我尝试配置my.cnf文件

sudo vim /etc/MysqL/my.cnf

[MysqLd]
user            = MysqL
pid-file        = /var/run/MysqLd/MysqLd.pid
socket          = /var/run/MysqLd/MysqLd.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/MysqL
tmpdir          = /tmp
lc-messages-dir = /usr/share/MysqL
skip-external-locking
local-infile = 1
[MysqL]
#no-auto-rehash # faster start of MysqL but no tab completition
local-infile = 1

然后重启MysqL服务器:

sudo service MysqL restart
MysqL stop/waiting
MysqL start/running,process 9563

但后来我仍然得到:

DBD::MysqL::st execute Failed: The used command is not allowed with this MysqL version at ../Apps/orthomclSoftware-v2.0.3/bin/orthomclLoadBlast line 39,<F> line 12.
The used command is not allowed with this MysqL version at ../Apps/orthomclSoftware-v2.0.3/bin/orthomclLoadBlast line 39,<F> line 12.`

第39行是:

$stmt->execute() or die DBI::errstr;

执行上面的行:

my $sql = "
LOAD DATA
LOCAL INFILE \"$blastFile\"
REPLACE INTO TABLE $sst
FIELDS TERMINATED BY '\\t'
";
my $stmt = $dbh->prepare($sql) or die DBI::errstr;

解决方法

dbConnectString=dbi:MysqL:orthomcl:MysqL_local_infile=1:localhost:3306

我也在MysqL.cnf中添加

[client]
      loose-local-infile=1

为我工作

猜你在找的Perl相关文章