MySQL Error Code: 2068. LOAD DATA LOCAL INFILE file request rejected ……解决方案

操作环境: workbench MySQL5.7

问题描述

在workbench中建好表之后,通过下面的命令导入外部数据出现Error Code2068;

load data local infile 'E:\\student_info.txt' 
into table student_info character set utf8 fields terminated by ',' ignore 1 lines;

实际在workbench中导入外部数据不同于在cmd命令窗口操作MySQL,不用 "local" 命令,但是去掉 "local"仍然出错;

load data  infile 'E:\\student_info.txt' 
into table student_info character set utf8 fields terminated by ',' ignore 1 lines;

执行此命令出现:Error Code: 1290. The MySQL server is running with the --secure-file-priv option so it cannot execute this statement. 说明此路径下的数据导入是不允许的。

问题解决

首先我们需要找到在workbench中导入如外部数据所允许的路径;

show variables like '%secure%';
#输入此命令找到所允许操作的路径

 将要导入的外部数据移至此路径下;

 在workbench中执行以下命令即可成功导入数据;

load data  infile 'C:\\ProgramData\\MySQL\\MySQL Server 5.7\\Uploads\\student_info.txt' 
into table student_info character set utf8 fields terminated by ',' ignore 1 lines;

查看数据是否导入成功;

 成功导入;

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Arrogant-cell

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值