错误phpmyadmin #2000 -加载数据本地INFILE是禁止的,检查mysqli.allow_local_infile

huus2vyu  于 2023-02-07  发布在  PHP
关注(0)|答案(1)|浏览(407)

当我们通过phpmyadmin使用“csv using load data”导入一个csv时,我们在phpmyadmin中有这个错误并且从csv导入到我们的表中没有完成. phpmyadmin版本4.4.15.10
使用另一个版本的phpmyadmin4.4.15.8,使用相同的数据库和相同的数据服务器,我们没有问题。
谢谢你的回答
请求SQL:

LOAD DATA LOCAL INFILE '/tmp/phpRH1Q9u' INTO TABLE `glpi_corresp_usernames` FIELDS TERMINATED BY ';' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\r\n'
MySQL a répondu: Documentation

#2000 - LOAD DATA LOCAL INFILE is forbidden, check mysqli.allow_local_infile

 phpMyAdminWarning in ./libraries/dbi/DBIMysqli.class.php#262
 mysqli_query(): LOAD DATA LOCAL INFILE forbidden

Backtrace

./libraries/dbi/DBIMysqli.class.php#262: mysqli_query(
object,
string 'LOAD DATA LOCAL INFILE \'/tmp/phpRH1Q9u\' INTO TABLE `glpi_corresp_usernames` FIELDS TERMINATED BY \';\' ENCLOSED BY \'"\' ESCAPED BY \'\\\\\' LINES TERMINATED BY \'\\r\\n\'',
integer 0,
)
./libraries/DatabaseInterface.class.php#183: PMA_DBI_Mysqli->realQuery(
string 'LOAD DATA LOCAL INFILE \'/tmp/phpRH1Q9u\' INTO TABLE `glpi_corresp_usernames` FIELDS TERMINATED BY \';\' ENCLOSED BY \'"\' ESCAPED BY \'\\\\\' LINES TERMINATED BY \'\\r\\n\'',
object,
integer 0,
)
./libraries/import.lib.php#170: PMA_DatabaseInterface->tryQuery(string 'LOAD DATA LOCAL INFILE \'/tmp/phpRH1Q9u\' INTO TABLE `glpi_corresp_usernames` FIELDS TERMINATED BY \';\' ENCLOSED BY \'"\' ESCAPED BY \'\\\\\' LINES TERMINATED BY \'\\r\\n\'')
./libraries/plugins/import/ImportLdi.class.php#158: PMA_importRunQuery()
./import.php#615: ImportLdi->doImport(array)
avwztpqn

avwztpqn1#

这有助于我在phpMyAdmin中的情况:
1.运行以下命令:显示全局变量,如"local_infile";
1.如果值为OFF运行:设置全局本地输入文件=真;
1.然后就像@Guido Faecke说的检查你的php.ini是否有mysqli. allow_local_infile = On
1.在此行中删除分号-〉;mysqli.允许本地文件=打开
1.重新启动apache然后你可以运行
加载数据本地文件...

相关问题