[Mysql] export a Mysql table to Excel

Source: Internet
Author: User

[Mysql] export a Mysql table to Excel

Exporting a Mysql table to Excel is not as difficult as importing an Excel table to one of the Mysql tables (click to open the link,

Enter the following T-SQL statement directly:

Select * from a table into outfile 'file Path'
For example, I want to export an I _studenttable of the following testdata Library to the 1.xls directory of the D-root directory:

Use test
Then, enter:

Select * from I _student into outfile 'd:/1.xls'

For example:

Then you will find a 1.xls waiting for you on the dashboard. Of course, the following information may be prompted when you open it:


You can find that the content of 1.xls is as follows without the header id and name, but it is enough to query the content.

To promote any query content, you only need to modify the previous Export Statement.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.