如何将mysql表结构导出成Excel格式的
1个回答
展开全部
由于工作需要,经常需要将mysql数据库中的数据导出到excel表格,或者需要将excel表格数据导入到mysql数据库,我的方法是先将它们都转换成一种中间数据格式csv(execl数据可以直接导出为csv格式,csv格式也可以直接用excel打开)。下面介绍一下操作步骤:
csv导入mysql
load data infile 'C:\\Users\\UserName\\Desktop\\test.csv'
into table `table`
fields terminated by ',' optionally enclosed by '"' escaped by '"'
lines terminated by '\n';
mysql导入csv
select * from `table`
load data infile 'C:\\Users\\UserName\\Desktop\\test.csv'
fields terminated by ',' optionally enclosed by '"' escaped by '"'
lines terminated by '\n';
如果乱码,可用相关编辑器打开.csv文件,另存为utf-8的csv
csv导入mysql
load data infile 'C:\\Users\\UserName\\Desktop\\test.csv'
into table `table`
fields terminated by ',' optionally enclosed by '"' escaped by '"'
lines terminated by '\n';
mysql导入csv
select * from `table`
load data infile 'C:\\Users\\UserName\\Desktop\\test.csv'
fields terminated by ',' optionally enclosed by '"' escaped by '"'
lines terminated by '\n';
如果乱码,可用相关编辑器打开.csv文件,另存为utf-8的csv
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询