Home >Backend Development >PHP Tutorial > mysql 中怎么导入.txt文件

mysql 中怎么导入.txt文件

WBOY
WBOYOriginal
2016-06-13 13:00:25902browse

mysql 中如何导入.txt文件
mysql 中如何导入.txt文件
文件内容行如:

------解决方案--------------------
先建立表,然后执行
load data local infile "c:/data.txt"
into table tt(id,time1,time2); 

------解决方案--------------------
先建立表,比如表名为sa,字段为  id ,date1,date2 , source
然后 在命令行上  load data local infile "c:/sa.txt" into table sa(id,date1,date2,source);

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn