[MonetDB-users] can't copy into a remote server in windows
Hi all: we want to copy a txt file into a remote monetdb (windows). if we copy into local monetdb via ipaddress, it's OK. but if we copy the same txt file into a remote monetdb, it can't. Error: could not open file 'd:\\share\\book1.csv': Operation not permitted SQLState: 22000 ErrorCode: 0 what's the problem? is it a bug? or something we don't know? lixiaohua Shanghai,China
On 2012-07-25 15:32, li, xiaohua wrote:
Hi all: we want to copy a txt file into a remote monetdb (windows). if we copy into local monetdb via ipaddress, it's OK. but if we copy the same txt file into a remote monetdb, it can't.
Error: could not open file 'd:\\share\\book1.csv': Operation not permitted SQLState: 22000 ErrorCode: 0
what's the problem? is it a bug? or something we don't know?
lixiaohua Shanghai,China
Assuming you use something like COPY INTO t FROM 'd:\\share\\book1.csv' ... then the mserver has to be able to read the file using that path. If you're logged into the mserver with an account other than monetdb, this will not be allowed for security reasons. If you do this remotely (i.e. the server runs on a different system than mclient), the server will try to read the file on it's system, not mclient's system. If you want a remote mserver to read a file on the same host as where mclient is running, you have to send the file through mclient (which is a bit tricky on Windows). Start by looking at http://www.monetdb.org/Documentation/Cookbooks/SQLrecipies/LoadingData and the manual page at http://www.monetdb.org/Documentation/mclient-man-page on how this can be done. You'll need to use the mclient.bat script instead of the mclient.exe binary and run all of this from a cmd window. The description is written with Linux in mind, but something very similar should also work on Windows. You may have to specify a -E option (see the manual). -- Sjoerd Mullender
On Wed, Jul 25, 2012 at 04:35:01PM +0200, Sjoerd Mullender wrote:
On 2012-07-25 15:32, li, xiaohua wrote:
Hi all: we want to copy a txt file into a remote monetdb (windows). if we copy into local monetdb via ipaddress, it's OK. but if we copy the same txt file into a remote monetdb, it can't.
Error: could not open file 'd:\\share\\book1.csv': Operation not permitted SQLState: 22000 ErrorCode: 0
what's the problem? is it a bug? or something we don't know?
lixiaohua Shanghai,China
Assuming you use something like COPY INTO t FROM 'd:\\share\\book1.csv' ... then the mserver has to be able to read the file using that path. If you're logged into the mserver with an account other than monetdb, this will not be allowed for security reasons. If you do this remotely (i.e. the server runs on a different system than mclient), the server will try to read the file on it's system, not mclient's system.
If you want a remote mserver to read a file on the same host as where mclient is running, you have to send the file through mclient (which is a bit tricky on Windows).
Start by looking at http://www.monetdb.org/Documentation/Cookbooks/SQLrecipies/LoadingData and the manual page at http://www.monetdb.org/Documentation/mclient-man-page on how this can be done. You'll need to use the mclient.bat script instead of the mclient.exe binary and run all of this from a cmd window. The description is written with Linux in mind, but something very similar should also work on Windows.
You may have to specify a -E option (see the manual).
-- Sjoerd Mullender
from http://sourceforge.net/mailarchive/message.php?msg_id=29589054: " I have find the solution you must do COPY INTO from PROMPT OF DOS like this: C:\Program Files\MonetDB\MonetDB5> mclient -d demo -s " COPY INTO LINEORDER FROM STDIN USING DELIMITERS '|','\n'" - < G:\BDC\DATA\LINEORDER.tbl LINEORDER IS the table in database and LINEORER.tbl is the text file that contain data to load, and demo is the name of database " Stefan
------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- | Stefan.Manegold @ CWI.nl | DB Architectures (INS1) | | http://CWI.nl/~manegold/ | Science Park 123 (L321) | | Tel.: +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
thanks for detailed suggetion.
We now know the reason why it can't, very clearly.
but use mlient to copy into table seems have a chinese character problem.
the day before yestaday,we use mclient to copy into a txt character, it can
be load in, but the chinese character is bad.
2012/7/25 Stefan Manegold
On 2012-07-25 15:32, li, xiaohua wrote:
Hi all: we want to copy a txt file into a remote monetdb (windows). if we copy into local monetdb via ipaddress, it's OK. but if we copy the same txt file into a remote monetdb, it can't.
Error: could not open file 'd:\\share\\book1.csv': Operation not
On Wed, Jul 25, 2012 at 04:35:01PM +0200, Sjoerd Mullender wrote: permitted
SQLState: 22000 ErrorCode: 0
what's the problem? is it a bug? or something we don't know?
lixiaohua Shanghai,China
Assuming you use something like COPY INTO t FROM 'd:\\share\\book1.csv' ... then the mserver has to be able to read the file using that path. If you're logged into the mserver with an account other than monetdb, this will not be allowed for security reasons. If you do this remotely (i.e. the server runs on a different system than mclient), the server will try to read the file on it's system, not mclient's system.
If you want a remote mserver to read a file on the same host as where mclient is running, you have to send the file through mclient (which is a bit tricky on Windows).
Start by looking at http://www.monetdb.org/Documentation/Cookbooks/SQLrecipies/LoadingData and the manual page at http://www.monetdb.org/Documentation/mclient-man-page on how this can be done. You'll need to use the mclient.bat script instead of the mclient.exe binary and run all of this from a cmd window. The description is written with Linux in mind, but something very similar should also work on Windows.
You may have to specify a -E option (see the manual).
-- Sjoerd Mullender
from http://sourceforge.net/mailarchive/message.php?msg_id=29589054: " I have find the solution
you must do COPY INTO from PROMPT OF DOS like this:
C:\Program Files\MonetDB\MonetDB5> mclient -d demo -s " COPY INTO LINEORDER FROM STDIN USING DELIMITERS '|','\n'" - < G:\BDC\DATA\LINEORDER.tbl
LINEORDER IS the table in database and LINEORER.tbl is the text file that contain data to load, and demo is the name of database "
Stefan
------------------------------------------------------------------------------
Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- | Stefan.Manegold @ CWI.nl | DB Architectures (INS1) | | http://CWI.nl/~manegold/ | Science Park 123 (L321) | | Tel.: +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- 上海云数信息科技有限公司 http://www.cloudybi.com 联系人:李晓华 职务:总经理 手机:18616507502
participants (3)
-
li, xiaohua
-
Sjoerd Mullender
-
Stefan Manegold