MySQL Workbench加载数据本地文件错误 [英] MySQL Workbench Load Data Local Infile error

查看:340
本文介绍了MySQL Workbench加载数据本地文件错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在遇到MySQL的加载数据本地Infile"命令的问题.我知道,由于安全威胁,他们默认情况下将其禁用.我有一个要在MySql Workbench中运行的SQL脚本.我不断收到错误消息1148.此MySQL版本不允许使用的命令."我已经能够使用命令行参数从命令行上使它工作.但是,我在工作台上还没有取得任何成功.任何帮助,将不胜感激.这是我的剧本.

I have been running into a problem with MySQL's Load Data Local Infile command. I know that they disabled it by default due to a security threat. I have a SQL Script that I would like to run in MySql Workbench. I keep getting the error "1148. The used command is not allowed with this MySQL version." I have been able to get this to work from the command line using command line arguements. However I havent had any success in the Workbench. Any help would be appreciated. Here is my script.

DROP DATABASE IF EXISTS a2004TS;

CREATE DATABASE IF NOT EXISTS a2004TS;

USE a2004TS;

DROP TABLE IF EXISTS a2004TS_1;

CREATE TABLE a2004TS_1(
Version CHARACTER(25),
Dsetid CHARACTER(6),
V040001 DOUBLE,
..
.
);

SET GLOBAL local_infile = 1;

LOAD DATA LOCAL INFILE '/home/output/sqlCSV/a2004TS.sqlscripts.table1.csv'
INTO TABLE a2004TS_1
FIELDS TERMINATED BY ',' ENCLOSED BY'"'
LINES TERMINATED BY'
'(columns......);

推荐答案

如果服务器以禁用LOAD DATA的选项启动,则客户端必须显式调用mysql_options(...)来启用它( http://dev.mysql.com/doc/refman/5.5/en /load-data-local.html ).在WB中不会发生这种情况,因此您当前无法使用它来加载文件.而是使用命令行客户端.

If the server is started with the option to disable LOAD DATA then a client has to explicitly call mysql_options(...) to enable it (http://dev.mysql.com/doc/refman/5.5/en/load-data-local.html). This does not happen in WB, so you cannot use it to load a file currently. Instead use the command line client for this.

您可以在 http://bugs.mysql.com 上提交功能请求,以实现允许的处理导入(例如,首选项设置).

You could file a feature request at http://bugs.mysql.com to have handling implemented that allows the import (e.g. a preference setting).

这篇关于MySQL Workbench加载数据本地文件错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆