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??
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
I've used the
OUTFILE
method before to do this: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:
This should give you a file called:
/tmp/orders.csv
which will open in Excel.The slowness of your export is likely due to the server on which phpmyadmin runs. I regularly export millions of rows with surprising speed.
If you have access to the file system of your database server, this is a very fast way of converting to .csv, which in turn can be opened by Excel.
See this: http://www.tech-recipes.com/rx/1475/save-mysql-query-results-into-a-text-or-csv-file/