show v..._mysql score 倒入数据库">
赞
踩
load data infile "文件名"
into table 表名
fields terminated by "分隔符"
lines terminated by "\n"
示例
scoretable.csv文件导入到数据库db2的表
1、将scoretable.csv放到数据库搜索路径中
mysql>show variables like 'secure_file_priv';
/var/lib/mysql-files/
Linux: sudo cp /home/tarena/scoreTable.csv /var/lib/mysql-files/
2、在数据库中创建对应的表
create table scoretab(
rank int,
name varchar(20),
score float(5,2),
phone char(11),
class char(7)
)charset=utf8;
3、执行数据导入语句
load data infil
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。