本文介绍了如何将格式化的文本文件导入mysql数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用Mac终端,当文本文件具有这种格式时,如何填充mysql数据库.
sing the Mac terminal, how could you populate a mysql database when the text file has a format like this.
00000,1284
00001,2081
我已经创建了数据库表来反映该数据,但是我不确定如何导入这种格式的文本文件.
I have created the database table to reflect that data however I am not sure on how to import a text file with this type of format..
这是我现在正在尝试使用的方法,但是它不起作用
This is what I am trying to use right now but its not working
LOAD DATA INFILE 'Developer/Shared Files/NIS.txt INTO TABLE nisC FIRLDS TERMINATED BY ',';
推荐答案
使用以下语句
LOAD DATA INFILE 'Developer/Shared Files/NIS.txt' INTO TABLE nisC (field1, field2);
这篇关于如何将格式化的文本文件导入mysql数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!