Introduction
In today’s data-driven world, the ability to connect and analyze data from different sources is a key skill for any data professional. One common requirement is integrating relational databases like MySQL with powerful visualization tools such as Microsoft Power BI.
While Power BI provides a native MySQL connector, there are situations where using an ODBC (Open Database Connectivity) connection is more flexible, especially in enterprise environments or when dealing with compatibility issues.
In this guide, I’ll walk through how to connect MySQL to Power BI using the ODBC driver, step by step.
What You Will Learn
By the end of this tutorial, you will be able to:
- Understand what ODBC is and why it’s used
- Install and configure the MySQL ODBC driver
- Set up a Data Source Name (DSN)
- Connect Power BI to MySQL using ODBC
- Troubleshoot common connection issues
Requirements
Before we begin, make sure you have:
- A running MySQL database (local or remote)
- Access credentials (username, password, host, port)
- Microsoft Power BI Desktop installed
- MySQL ODBC Driver installed
Step 1: Install MySQL ODBC Driver
First, download and install the MySQL ODBC driver (also known as MySQL Connector/ODBC).
- Visit the official MySQL website (https://www.mysql.com/)
- Click on Download
- Scroll down, click MySQL Community (GPL) Downloads
- Click Connector/ODBC
- Download the correct version (32-bit or 64-bit — must match your Power BI bit) note: ODBC is for 64-bit
- Complete the installation
Step 2: Configure ODBC Data Source (DSN)
- Once installed, you need to create a Data Source Name (DSN).
- Open ODBC Data Source Administrator
- Press Windows + S → Search ODBC Choose:
- Click on run as administration
- A box pop-up will show
- Click Add
- A box pop-up will show
- Select MySQL ODBC Driver
- A box pop-up will show
- Fill in the connection details:
- Data Source Name: (e.g., MySQL_PBI)
- Server: your MySQL host (e.g., localhost or IP)
- Port: usually 3306
- User: root
- Password: input your MySQL password (note: the password used in opening your MySQL is the same password you will input)
- Database name: your MySQL database name (e.g., moniespoint_DB)
- Click Test to confirm connection (if successful click OK, if not successful, is mean the password you input is incorrect)
- Save the DSN
Step 3: Connect Power BI to MySQL via ODBC
Now let’s bring the data into Power BI.
- Open Microsoft Power BI Desktop
- Click Get Data
- Click More
- Click Other
- Select ODBC and click connect
- Choose your DSN (e.g., MySQL_PBI)
- Enter credentials if prompted
- Select tables or write a SQL query
- Click Load or Transform Data
Step 4: Transform and Visualize Data
- Once your data is loaded:
- Use Power Query Editor to clean and transform
- Create relationships between tables
- Build dashboards using charts, KPIs, and slicers
Common Issues & Fixes
Here are some typical problems and how to solve them:
- Driver Mismatch (32-bit vs 64-bit): Ensure Power BI and ODBC driver use the same architecture
- Connection Failed: Check host, port, and credentials Ensure MySQL server is running
- Firewall Issues: Allow port 3306 on your server
- Authentication Errors: Confirm MySQL user permissions
Why Use ODBC Instead of Native Connector?
- Works across multiple database types
- More control in enterprise environments
- Useful when native connectors fail
- Standardized connection method
Conclusion
Connecting MySQL to Microsoft Power BI using ODBC is a reliable and flexible approach, especially when working in complex or restricted environments.
With the steps outlined above, you can now:
- Set up your ODBC driver
- Establish a secure connection
- Load and transform data in Power BI
- Build meaningful dashboards
As a data analyst, mastering connections like this expands your ability to work with diverse data sources and deliver impactful insights.
Top comments (0)