2012-10-31 9 views
5

Chi sa come attivare il caricamento delle impostazioni di infile locali nell'ultimo MySQL su Ubuntu? Ho modificato il file /etc/mysql/my.cnf e ha aggiuntocaricare l'infile locale non consentito perl mysql

local-infile=1 

E nel codice Perl

dbConnectString=dbi:mysql:orthomcl:mysqllocalinfile=1 

ma ancora ottenere

DBD::mysql::st execute failed: The used command is not allowed with this MySQL version... 

E 'utilizzato da un'applicazione chiamata OrthoMCL

ho provato configurazione del file 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 

Poi un riavvio del server MySQL:

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

Ma poi ho ancora:

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.` 

Linea 39 è:

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

che esegue le righe precedenti :

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

[Set Carico Infile] (http://stackoverflow.com/questions/10762239/enable- load-data-local-infile) Aggiornare i problemi di fronte @Jasper – gks

+0

Ho aggiornato il mio post sopra e ho detto che in effetti ho provato quel post in diversi modi, ma nessuno sembra funzionare. – Jasper

+0

il tuo 'dbConnectString' ha un formato strano per me. Dovrebbe essere come 'dbi: DriverName: database_name' –

risposta

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

ho aggiunto anche in mysql.cnf sotto

[client] 
     loose-local-infile=1 

ha lavorato per me

+0

Risolto il problema con orthoMCL. Grazie. – Morlock

+0

L'aggiunta di mysql_local_infile = 1 al DBI DSN dovrebbe essere sufficiente. –

Problemi correlati