LOAD DATA INFILE问题.... [英] LOAD DATA INFILE problem....

查看:84
本文介绍了LOAD DATA INFILE问题....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我有一个关于LOAD DATA INFILE的问题。有人可以节省我的一天。


1.我想将一个txt文件导入mysql数据库。
当我在mysql中使用以下查询时,
>提示它的罚款。

这是


当我这样做时java我收到错误


错误

-----------

java.sql.sqlException:来自服务器的一般错误消息:

" File'' D:/Sen.txt''未找到< ErrCode:2>"



但该文件已存在


代码:

Hi guys,

I have got a question regarding LOAD DATA INFILE. Can some one save my day.

1. I want to import a txt file into mysql database.
when I use the following query in the mysql> prompt its fine.
which is

when I do it java I am getting error

Error
-----------
java.sql.sqlException: General error message from server:
"File ''D:/Sen.txt'' not found <ErrCode: 2>"


But The file already exists

Code:

展开 | 选择 | Wrap | 行号

推荐答案


大家好,


我有一个问题加载数据信息。有人可以节省我的一天。


1.我想将一个txt文件导入mysql数据库。
当我在mysql中使用以下查询时,
>提示它的罚款。

这是


当我这样做时java我收到错误


错误

-----------

java.sql.sqlException:来自服务器的一般错误消息:

" File'' D:/Sen.txt''未找到< ErrCode:2>"



但该文件已存在


代码:
Hi guys,

I have got a question regarding LOAD DATA INFILE. Can some one save my day.

1. I want to import a txt file into mysql database.
when I use the following query in the mysql> prompt its fine.
which is

when I do it java I am getting error

Error
-----------
java.sql.sqlException: General error message from server:
"File ''D:/Sen.txt'' not found <ErrCode: 2>"


But The file already exists

Code:
展开 | 选择 | Wrap | 行号



大家好,


我有一个关于LOAD DATA INFILE的问题。有人可以节省我的一天。


1.我想将一个txt文件导入mysql数据库。
当我在mysql中使用以下查询时,
>提示它的罚款。

这是


当我这样做时java我收到错误


错误

-----------

java.sql.sqlException:来自服务器的一般错误消息:

" File'' D:/Sen.txt''未找到< ErrCode:2>"



但该文件已存在


代码:
Hi guys,

I have got a question regarding LOAD DATA INFILE. Can some one save my day.

1. I want to import a txt file into mysql database.
when I use the following query in the mysql> prompt its fine.
which is

when I do it java I am getting error

Error
-----------
java.sql.sqlException: General error message from server:
"File ''D:/Sen.txt'' not found <ErrCode: 2>"


But The file already exists

Code:
展开 | 选择 | Wrap | 行号



必须是某个目录。我自己从未用过Java。快速检查此处表明您有权从mysql运行提示。 Java查找从您的代码所在的当前目录开始的文件,但mysql从数据库目录中查找该文件...仍然试图确定如果你得到它可以在那里工作,请发布并告诉我们。
Must be some directory thing. I''ve never used it in Java myself. A quick check here shows that you have it right for running from mysql prompt. Java looks for the file starting in the current directory where your code is but mysql looks for the file from the database directory... Still trying to fihure out what would work there if you get it please post and tell us as well.



嘿另外一件事...


但是当我尝试使用filename =" C:/test.txt"时;


itz从数据库导入数据并将其完美地加载到文本文件中..


但是这里的特别之处是...... .. C中没有test.txt文件:/ b

实际上test.txt文件是使用查询创建的文件


在java程序中SELECT * INTO OUTFILE导出数据到文件(C:/test.txt)..


当我运行上面的程序时...


C中没有test.txt文件:/ ....


但是当我试图再次运行程序时......抛出异常


C:/test.txt文件已经存在...但是没有test.txt文件..


i不知道这里发生了什么...


该怎么办...


plzz解释我....

Hey another one things...

But when i tried the filename = "C:/test.txt"

itz import the data from the database and load it to the text file perfectly..

but whatz special in this is.... there is no test.txt file in the C:/

Actually test.txt file is a created file by using Query

SELECT * INTO OUTFILE in the java program for export data to a file(C:/test.txt)..

When i run the above program...

there is no test.txt file in the C:/....

But when i tried to run the program again... its throwing exception

that C:/test.txt file is already exist... But there is no test.txt file..

i dont know what is happening here...

What to do for it...

plzz explain me....


这篇关于LOAD DATA INFILE问题....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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