VOOZH about

URL: https://www.cdata.com/kb/tech/mysql-odbc-powerpivot.rst

โ‡ฑ Analyze MySQL Data with Power Pivot


Analyze MySQL Data with Power Pivot

๐Ÿ‘ Jerod Johnson
Jerod Johnson
Director, Technology Evangelism
This article walks you through the process of using the CData ODBC Driver for MySQL from Power Pivot. You will use the Table Import Wizard to load MySQL data. You can visually build the import query or use any SQL supported by the driver.

๐Ÿ‘ The data source modeled as tables.

The ODBC protocol is used by a wide variety of Business Intelligence (BI) and reporting tools to get access to different databases. The CData ODBC Driver for MySQL brings the same power and ease of use to MySQL data. This article uses the driver to import MySQL data into Power Pivot.

Connect to MySQL as an ODBC Data Source

If you have not already, first specify connection properties in an ODBC DSN (data source name). This is the last step of the driver installation. You can use the Microsoft ODBC Data Source Administrator to create and configure ODBC DSNs.

The CData Provider supports connecting to on-premises and cloud-hosted versions of MySQL such as Amazon RDS for MySQL, Google Cloud SQL for MySQL, Azure Database for MySQL, or Oracle MySQL HeatWave. The Server and Port properties must be set to a MySQL server. If IntegratedSecurity is set to false, then User and Password must be set to valid user credentials. Optionally, Database can be set to connect to a specific database. If not set, tables from all databases will be returned.

SSH Connectivity for MySQL

You can use SSH (Secure Shell) to authenticate with MySQL, whether the instance is hosted on-premises or in supported cloud environments. SSH authentication ensures that access is encrypted (as compared to direct network connections).

SSH Connections to MySQL in Password Auth Mode

To connect to MySQL via SSH in Password Auth mode, set the following connection properties:

  • User: MySQL User name
  • Password: MySQL Password
  • Database: MySQL database name
  • Server: MySQL Server name
  • Port: MySQL port number like 3306
  • UserSSH: "true"
  • SSHAuthMode: "Password"
  • SSHPort: SSH Port number
  • SSHServer: SSH Server name
  • SSHUser: SSH User name
  • SSHPassword: SSH Password

SSH Connections to MySQL in Public Key Auth Mode

To connect to MySQL via SSH in Password Auth mode, set the following connection properties:

  • User: MySQL User name
  • Password: MySQL Password
  • Database: MySQL database name
  • Server: MySQL Server name
  • Port: MySQL port number like 3306
  • UserSSH: "true"
  • SSHAuthMode: "Public_Key"
  • SSHPort: SSH Port number
  • SSHServer: SSH Server name
  • SSHUser: SSH User name
  • SSHClientCret: the path for the public key certificate file

Connect from Power Pivot

Follow the steps below to connect to the DSN in Power Pivot.

  1. In Excel, click the Power Pivot Window icon on the Power Pivot tab to open Power Pivot.
  2. Launch the Table Import Wizard: Click the Get External Data from Other Data Sources button.
  3. Select the OLEDB/ODBC source option.
  4. Click Build to open the Data Link Properties dialog.
  5. In the Provider tab, select the Microsoft OLEDB Provider for ODBC Drivers option.
  6. In the Connection tab, select the Use Data Source Name option and then select the MySQL DSN in the menu.

Select and Filter Tables and Views

Follow the steps below to use the wizard to import MySQL tables. As you use the wizard to select, filter, and sort columns of MySQL tables, Power Pivot generates the query to be executed.

  1. After selecting the DSN in the Table Import Wizard, select the option to select from a list of tables.

  2. Click Preview & Filter to select specific columns, sort data, and visually build filters. To include or exclude columns, select and clear the option next to the column name.

    To filter based on column values, click the down arrow button next to the column name. In the resulting dialog, select or clear the column values you want to filter. Alternatively, click Number Filters or Text Filters and then select a comparison operator. In the resulting dialog, build the filter criteria.

  3. Return to the Select Tables and Views page of the wizard. You can access filters by clicking the Applied Filters link in the Filter Details column.
๐Ÿ‘ The data source modeled as tables.

Import and Filter with SQL

You can also import with an SQL query. The driver supports the standard SQL, allowing Excel to communicate with MySQL APIs.

  1. After selecting the DSN in the Table Import Wizard, select the option to write a query.
  2. In the SQL Statement box, enter the query. Click Validate to check that the syntax of the query is valid. Click Design to preview the results and adjust the query before import.

    ๐Ÿ‘ The query to be used to import the data.
  3. Finish the wizard to import the data for your chosen query.
๐Ÿ‘ The imported data.

Refresh On Demand

Connectivity to MySQL APIs enables real-time analysis. To immediately update your workbook with any changes, click Refresh.

Ready to get started?

Download a free trial of the MySQL ODBC Driver to get started:

 Download Now

Learn more:

๐Ÿ‘ MySQL Icon
MySQL ODBC Driver

The MySQL ODBC Driver is a powerful tool that allows you to connect with live MySQL data, directly from any applications that support ODBC connectivity.

Access MySQL databases from virtually anywhere through a standard ODBC Driver interface.