TXT文本
文件中(记得把后面的空格消掉。。否则导入数据库后会有对应的
空行
),假如存到“D:\datatxt”这个位置里。
2根据要导入的数据快儿建立
MySql数据库
和表,然后进入命令提示符里使用命令
load
data
local
infile
'D:/datatxt'
into
table
exceltomysql
fields
terminated
by
'\t';
注意:
盘符
我使用的“/”才成功,否则提示找不到文件
下面文章中是用的“\”!
进行导入 *** 作
手动进行Excel数据和MySql
数据转换我给你一些数据库常用的导入导出命令吧:\x0d\该命令在“开始菜单>>运行>>CMD”中执行\x0d\一、数据导出(expexe)\x0d\1、将数据库orcl完全导出,用户名system,密码accp,导出到d:\daochudmp文件中\x0d\exp system/accp@orcl file=d:\daochudmp full=y\x0d\\x0d\2、将数据库orcl中scott用户的对象导出\x0d\exp scott/accp@orcl file=d:\daochudmp owner=(scott)\x0d\\x0d\3、将数据库orcl中的scott用户的表emp、dept导出\x0d\exp scott/accp@orcl file= d:\daochudmp tables=(emp,dept)\x0d\\x0d\4、将数据库orcl中的表空间testSpace导出\x0d\exp system/accp@orcl file=d:\daochudmp tablespaces=(testSpace)\x0d\\x0d\二、数据导入(impexe)\x0d\1、将d:\daochudmp 中的数据导入 orcl数据库中。\x0d\imp system/accp@orcl file=d:\daochudmp full=y\x0d\\x0d\2、如果导入时,数据表已经存在,将报错,对该表不会进行导入;加上ignore=y即可,表示忽略现有表,在现有表上追加记录。\x0d\imp scott/accp@orcl file=d:\daochudmp full=y ignore=y\x0d\\x0d\3、将d:\daochudmp中的表emp导入\x0d\imp scott/accp@orcl file=d:\daochudmp tables=(emp)
1)打开你的sql server,找到要导入数据的数据库,右键——〉任务——〉导入数据
2)按照图示选择要导入的excel
3)选择导入到哪个数据库
4)导入excel选择第一项即可,选择第二项是表与表直接内容的筛选复制
5)选择源表和源视图
6)编辑映射页面
7)继续下一步,点击完成,看到传输数据完成页面
8)进入数据库刷新,查看刚刚导入的表,完成!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)