mysql中导入txt文件

本文介绍了如何在Windows环境下使用MySQL Workbench将TXT文件导入到MySQL数据库中,并提供了创建表结构的具体语法。此外还详细说明了命令中各参数的含义及使用注意事项。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1 windows 下 mysql导入txt文件(使用mysql的workbench)

load data local infile 'path' into table table_name

fields terminated by '\t' lines terminated by '\r\n';

注意:这里的引号全是正常的单引号,ptah的格式为绝对路径(每个反斜杠之后再加一个反斜杠,转义),如:C:\\Users\\DELL\\Desktop\\data\\Data\\JingdongData\\record_all.txt

2,mysql 创建表

create table table_name

( userid int(11) not null;

  productid int(11) not null

);

或者都加ESC下面的波浪引号,如:

create table `table_name`

(

  `userid` int(11) not null;

   `productid` int(11) not null

);

注意的是引号的不同。

 

转载于:https://www.cnblogs.com/baiting/p/5038328.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值