码迷,mamicode.com
首页 > 数据库 > 详细

LOAD CSV ERROR: The used command is not allowed with this MySQL version

时间:2019-08-10 09:35:11      阅读:89      评论:0      收藏:0      [点我收藏+]

标签:ror   row   cal   pat   close   sed   rmi   val   local   

要执行的sql

把csvload进db

LOAD DATA LOCAL INFILE '/path/datas/temp.csv' INTO TABLE test_table_name FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 ROWS;

把客户端和server端 local_infile 都设置为True/ON

# server端
mysql> SHOW VARIABLES LIKE '%local%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| local_infile  | ON    |
+---------------+-------+

# 客户端
connect = pymysql.connect(host=host, user=user_name, passwd=password, db=db_name, charset='utf8',  local_infile=True)

LOAD CSV ERROR: The used command is not allowed with this MySQL version

标签:ror   row   cal   pat   close   sed   rmi   val   local   

原文地址:https://www.cnblogs.com/wangjiale1024/p/11330431.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!