当文件位于另一个位置时如何使用 LOAD DATA INFILE 语句?
我想使用 LOAD DATA INFILE 语句导入表中的数据。
如果该文件在同一系统上可用,则它可以正常工作并成功导入,但是当该文件位于另一个系统上时,它无法找到路径。
谁能解释如何使用 LOAD DATA INFILE 语句将数据从另一个系统或远程导入到 MySQL 表中?
I want to use LOAD DATA INFILE
statement to import data in my table.
If the file is available on the same system, it works nicely and imports successfully, but when the file is located on another system, it cannot locate the path.
Can anyone explain how to use the LOAD DATA INFILE
statement to import data into MySQL table from another system, or remotely?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您执行
LOAD DATA INFILE
< /a>,该文件必须位于运行 MySQL 数据库的系统上的数据路径中。如果该文件位于您的系统上,请添加
LOCAL
关键字。然后,该文件将被发送到服务器,存储在临时目录中,并从那里运行。仅当设置了必要的权限时,这才有效。When you do a
LOAD DATA INFILE
, the file must be on the system that is running the MySQL database, in the data path.If the file is on your system, add the
LOCAL
keyword. The file will then be sent to the server, stored in a temporary directory, and run from there. This only works if the necessary permissons are set.