免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2111 | 回复: 3
打印 上一主题 下一主题

mysql5.5 local infile问题求助 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2017-04-14 11:05 |只看该作者 |倒序浏览
本帖最后由 illiteracyzx 于 2017-04-14 11:06 编辑

请问下高手,为什么5.5下,local_infile默认已经是ON,但是 执行load data local infile时,提示ERROR 1148 (42000): The used command is not allowed with this MySQL version

但是,mysql --local-infile -uroot -p 后,就可以load data local infile了

############
root@host:~# mysql  -uroot -p111111
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 30
Server version: 5.5.22-0ubuntu1-log (Ubuntu)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show variables like 'local_infile';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| local_infile  | ON    |
+---------------+-------+
1 row in set (0.00 sec)
mysql> load data local infile '/root/111' into table db.table fields terminated by ','  lines terminated by ';\n' (id,time);
ERROR 1148 (42000): The used command is not allowed with this MySQL version
############
谢谢了。。

20170414110119.jpg (55.75 KB, 下载次数: 41)

20170414110119.jpg

论坛徽章:
0
2 [报告]
发表于 2017-04-14 12:58 |只看该作者
没人解答。。。

论坛徽章:
93
2015年辞旧岁徽章
日期:2019-10-10 10:51:15CU大牛徽章
日期:2014-02-21 14:21:56CU十二周年纪念徽章
日期:2020-10-15 16:55:55CU大牛徽章
日期:2014-02-21 14:22:07羊年新春福章
日期:2019-10-10 10:51:39CU大牛徽章
日期:2019-10-10 10:55:38季节之章:春
日期:2020-10-15 16:57:40ChinaUnix元老
日期:2019-10-10 10:54:42季节之章:冬
日期:2019-10-10 10:57:17CU大牛徽章
日期:2014-02-21 14:22:52CU大牛徽章
日期:2014-03-13 10:40:30CU大牛徽章
日期:2014-02-21 14:23:15
3 [报告]
发表于 2017-04-20 15:17 |只看该作者
你用的 show variables 语句查看的是服务端的变量信息,load data local infile 需要服务端和客户端都允许才可以使用,而客户端默认是关闭的,所以表现出你所出现的现象。

你说的服务端的配置默认开启,在这里有说明:
https://dev.mysql.com/doc/refman ... sysvar_local_infile

客户端则是默认关闭的,请参考这里:
https://dev.mysql.com/doc/refman/5.5/en/load-data-local.html



论坛徽章:
0
4 [报告]
发表于 2017-04-25 11:17 |只看该作者
感谢版主解答
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP