MySQL for Excel Guide  /  Import MySQL Data into Excel

Chapter 5 Import MySQL Data into Excel

Data can be imported from MySQL into a Microsoft Excel worksheet by using the Import MySQL Data option after selecting either a table, view, or procedure to import.


The import-data operation ignores columns containing binary data (Varbinary or Blob). For details, see Known limitation for binary data.

To import MySQL data into an Excel worksheet

  1. Start Excel, select the Data menu tab, and then click MySQL for Excel to open the MySQL for Excel task pane.

  2. From the Open a MySQL Connection area in the task pane, double-click an existing local or remote connection to display the available database schemas.

  3. Select a schema from the list and click Next to display all database objects in the schema (tables, views, and procedures).

  4. Select the table, view, or procedure with data to import and then click Import MySQL Data. A preview window displays the selected data and provides Options and Advanced Options to be used during the import operation.

    For a description of each import option, see Importing a Table or View or Section 5.1, “Importing a Procedure”.

    For a description of each advanced option, see Section 5.2, “Import — Advanced Options”.

  5. Click Import to finish the operation.

The Import Data windows provides a preview of the columns to select during the import operation. You can specify both the columns and rows to import. As the following figure shows, the preview includes a small subset of the rows for the selected table or view.

Figure 5.1 Importing table data with MySQL for Excel

Content is described in the surrounding text.

Importing a Table or View.  Import-data options apply to the current operation only. The options for importing a table or view are:

  • Include Column Names as Headers: Selected by default, this inserts the column names at the top of the Microsoft Excel worksheet as a "headers" row.

  • Limit to ___ Rows and Start with Row ___: Deselected by default, this limits the range of imported data. The Limit to option defaults to 1, and defines the number of rows to import. The Start with Row option defaults to 1 (the first row), and defines where the import begins. Each option has a maximum value of COUNT(rows) in the table.

  • Create a PivotTable with the imported data: Deselected by default. For usage instructions, see Section 5.4, “Creating PivotTables”

  • Add Summary Fields: Deselected by default, this option adds a summary field to each column. For additional information, see Section 5.3, “Adding Summary Fields”.

Choosing Columns To Import.  By default, all columns are selected and will be imported. Specific columns may be selected (or unselected) using the standard Microsoft Windows method of either Control + Mouse click to toggle the selection of individual columns, or Shift + Mouse click to select a range of columns.

The background color of a column shows the status of each column. The color white means that the column has been selected, and therefore it will be imported. Conversely, a gray background means that the column will not be imported.

Right-clicking anywhere in the preview grid opens a context-menu with either a Select None or Select All option, depending on the current status.