mysql导出csv文件命令_MySQL数据导入导出csv文件命令

MySql数据库导出csv文件命令:

mysql> select first_name,last_name,email from account into outfile 'e://output1.csv' fields terminated by ','optionally enclosed by ''lines terminated by '/n';

csv文件效果:

sunny

Grigoryan

lovechoosesun@gmail.com

Jon

Siegal

sun@riliantech.net

alejandro

medina

cvs文件导入MySql数据库命令:

mysql> load data local infile 'e://input1.csv' into table test1 fields termin

ated by ','lines terminated by '/n'(first_name,last_name,email);

Query OK, 1 row affected, 1 warning (0.00 sec)

Records: 69  Deleted: 0  Skipped: 68  Warnings: 0

mysql> select * from test1;

+----+------------+-----------+--------------------------+

| id | first_name | last_name | email                    |

+----+------------+-----------+--------------------------+

| 0 | sunny      | Grigoryan | lovechoosesun@gmail.com

+----+------------+-----------+--------------------------+

FIELDS TERMINATED BY ---- 字段终止字符 OPTIONALLY ENCLOSED BY ---- 封套符 LINES TERMINATED BY ---- 行终止符

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值