测试把txt文件导入至mysql数据库中:
table:
View CodeCREATE TABLE `pet` (`name` varchar(20) DEFAULT NULL,`owner` varchar(20) DEFAULT NULL,`species` varchar(20) DEFAULT NULL,`sex` char(1) DEFAULT NULL,`birth` date DEFAULT NULL,`death` date DEFAULT NULL)
txt文件:D:/data.txt (txt文件下载)
txt中使用 '/N' 描述null值。
导入数据:
View Codeload data local infile 'D:/data.txt' into table petlines terminated by '/r/n' ignore 1 lines;
应用mysql版本:
bitsCN.comCopyright © 2019- aiwanbo.com 版权所有 赣ICP备2024042808号-3
违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务