gpt4 book ai didi

mysql - LOAD DATA LOCAL INFILE 不适用于 IP 地址

转载 作者:行者123 更新时间:2023-11-29 17:48:47 25 4
gpt4 key购买 nike

我想在一台服务器上有 sql 且另一台服务器上有文件的环境中使用 mysql LOAD DATA LOCAL INFILE。

包含文件的服务器的 IP 地址为:192.XXX.XX.XX

文件服务器上文件的路径为:C:/repos/example.com/web/matches/temp/

我现在拥有的 mysql 无法正常工作,如下:

LOAD DATA 
LOCAL INFILE '//192.XXX.XX.XX/C:/repos/example.com/web/matches/temp/20180218test08Y_PeopleInMatches.txt'
INTO TABLE EventResultsSwimmersInSwims
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"'
LINES TERMINATED BY '\n' (UserID, CompetitorID, UserNumber, Time)
SET
MatchID = "20180218test08Y";

对此的任何帮助将不胜感激

最佳答案

“LOCAL”应按字面解释。它指的是运行 mysql 客户端的系统。请参阅documentation .

If LOCAL is specified, the file is read by the client program on the client host and sent to the server. The file can be given as a full path name to specify its exact location. If given as a relative path name, the name is interpreted relative to the directory in which the client program was started.

另一种选择,即不使用“LOCAL”,是从数据库服务器本身的目录中读取文件。

关于mysql - LOAD DATA LOCAL INFILE 不适用于 IP 地址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49579599/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com