5

Ubuntu 上の最新の MySQL でロード ローカル インファイル設定をオンにする方法を誰が知っていますか? /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;
4

1 に答える 1

7
dbConnectString=dbi:mysql:orthomcl:mysql_local_infile=1:localhost:3306

下のmysql.cnfにも追加しました

[client]
      loose-local-infile=1

私のために働いた

于 2012-12-27T22:21:39.543 に答える