问题描述
我在 mysql 中有一个表,它有超过 10 万行,非常大,我想将它导出到 excel.但是,我尝试在 phpmyadmin 上导出到 excel 功能,但是转储 excel 文件需要很长时间.它甚至不是倾倒.错误始终是连接已重置".有没有其他方法可以做到这一点?
I have a table in mysql which is quite big for having over 100k rows and I want to export it to excel. However, I tried the export to excel function on phpmyadmin but it takes forever to dump the excel file. It's not even dumping. The error is always, "the connection is reset". Is there an alternative way on how to do this??
推荐答案
首先,Excel 中的 100k 行听起来很糟糕,当然这需要一段时间.这将需要一段时间才能打开.如果您必须这样做,请尝试:
First, 100k rows in Excel sounds like a horrible idea and of course it'll take awhile. This is going to take awhile just to open. If you MUST do this try:
SELECT order_id,product_name,qty
FROM orders
INTO OUTFILE '/tmp/orders.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '
'
这应该会给你一个名为:/tmp/orders.csv 的文件,它将在 Excel 中打开.
This should give you a file called: /tmp/orders.csv which will open in Excel.
这篇关于如何将表从mysql数据库导出到excel?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!



大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)