How to retrieve data from MySQL to EXCEL
How to retrieve data from MySQL to EXCEL
Charge connector odbc
http://dev.mysql.com/downloads/connector/odbc/
Install ODBC in system
mysql-connector-odbc-5.2.4-winx64.msi
Go to the ODBC configuration in windows system
Conrol Panel -> Administrative Tools -> Data Sources (ODBC)
We start ODBC configuration
During configuration errors can occur - an error connecting to the server, check the database name or password or entered the correct port.
After the setup is complete, we can download the data to EXCEL
- We create a new Excel worksheet (Worksheet).
-
Select the top menu Data (Data), choose External Data (Import External Data) and choose from other sources ServerNew SQL Database Query.
-
Microsoft Query will start. First, you need to choose the data source, by selecting an existing Data Source Name.
-
Within the
Query Wizard
, choose the columns to import. The list of tables available to the user configured through the DSN is shown on the left, the columns that will be added to your query are shown on the right. The columns you choose are equivalent to those in the first section of aSELECT
query. Click to continue. -
You can filter rows from the query (the equivalent of a
WHERE
clause) using theFilter Data
dialog. Click to continue. -
Select an (optional) sort order for the data. This is equivalent to using a
ORDER BY
clause in your SQL query. You can select up to three fields for sorting the information returned by the query. Click to continue. -
Select the destination for your query. You can select to return the data Microsoft Excel, where you can choose a worksheet and cell where the data will be inserted; you can continue to view the query and results within Microsoft Query, where you can edit the SQL query and further filter and sort the information returned; or you can create an OLAP Cube from the query, which can then be used directly within Microsoft Excel. Click
.
The same process can be used to import data into a Word document, where the data will be inserted as a table. This can be used for mail merge purposes (where the field data is read from a Word table), or where you want to include data and reports within a report or other document.