这里的 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/