Pobieranie danych z MySQL do EXCEL
Jak pobrać dane z MySQL do EXCELA
Pobieramy connector odbc
http://dev.mysql.com/downloads/connector/odbc/
Instalujemy ODBC w systemie
mysql-connector-odbc-5.2.4-winx64.msi
Przechodzimy do konfiguracji ODBC w systemie windows 7
Panel sterowania -> Narzędzia administracyjne -> Źródło danych (ODBC)
Rozpoczynamy konfigurację ODBC
Podczas konfiguracji mogą pojawić się błędy - błąd połączenia z serwerem należy sprawdzić hasło nazwę bazy lub czy wpisano poprawny port.
Po zakończeniu konfiguracji możemy pobierać dane do EXCELA
- Tworzymy w Excelu nowy arkusz (Worksheet).
-
Wybieramy górne menu Dane (
Data)
, wybieramy Dane Zewnętrzne (Import External Data) i wybieramy
z innych źródeł z programu SQL ServerNew 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.