gpt4 book ai didi

MYSQL LOAD DATA INFILE Syntax Error - 哪里错了?

转载 作者:可可西里 更新时间:2023-11-01 07:57:09 24 4
gpt4 key购买 nike

这里的 Synthax 错误在哪里?

LOAD DATA INFILE 'mysqlout_back.txt' 
INTO TABLE temp (user,category,site,tld,ip,updated,date)
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n' ;

最佳答案

如果您只想加载特定列中的数据,则转到最后:

LOAD DATA INFILE 'mysqlout_back.txt' 
INTO TABLE temp FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n'
(user,category,site,tld,ip,updated,date) ;

编辑,关于您评论中的文件位置:

The server uses the following rules to locate the file:

  • If the file name is an absolute path name, the server uses it as given.
  • If the file name is a relative path name with one or more leading components, the server searches for the file relative to the server's data directory.
  • If a file name with no leading components is given, the server looks for the file in the database directory of the default database.

参见 MySQL ref

关于MYSQL LOAD DATA INFILE Syntax Error - 哪里错了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9251937/

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