如何从MySQL数据库中获取数据到Excel [英] How to fetch data from MySQL database into Excel

查看:589
本文介绍了如何从MySQL数据库中获取数据到Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从MySQL数据库表中获取数据到Excel?

解决方案

如果您的服务器也是您的客户端机器,

  select * from table1 into outfile'c​​:/path/outfile.csv'

$ b

(请注意,即使在Windows上使用正斜杠)



如果您的服务器是远程机器,请确保您的客户端计算机上安装了MySQL客户端软件,然后执行以下操作:

  mysql -eSELECT * from table1> file_name 

然后,您可以在Excel中打开csv文件。


How to fetch data from MySQL database table into Excel?

解决方案

If your server is also your client machine you can do

select * from table1 into outfile 'c:/path/outfile.csv'

(Note the use of forward slashes even on Windows)

If your server is a remote machine, make sure your have the MySQL client software installed on the client machine and do:

mysql -e "SELECT * from table1" > file_name

You can then open the csv file in Excel.

这篇关于如何从MySQL数据库中获取数据到Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆