Azure Database for MySQL

Use the Azure Database for MySQL connector to import database tables into Power Query Online by using a MySQL username and password. This article explains how to prepare the connection, select data, and resolve common connection issues.

Summary

Property Value
Connector Azure Database for MySQL icon Azure Database for MySQL
Products Power BI (semantic models)
Power Query Online
Release state General availability
Category Azure
Authentication kinds Basic
Data source kind AzureDatabaseForMySQL
Function Reference Documentation AzureDatabaseForMySQL.Database

Prerequisites

Before you connect, get the following information from your database administrator:

  • The fully qualified server name and the database name. Use the server's DNS name, not the URL of its Azure portal page. The Server field also accepts a port, for example contoso.mysql.database.azure.com:3306.
  • A MySQL username and password with permission to read the tables you want to import.
  • A network path from the service or gateway that runs your query to the database server.

For a server with public access, configure firewall rules to allow the connection from the service or gateway. For a private endpoint or a server using virtual network integration, use a connection path that can resolve and reach the private server. A successful connection from your own computer doesn't establish that the online service can reach the server. For more information, see Networking in Azure Database for MySQL.

Use an encrypted connection. Azure Database for MySQL Flexible Server enforces encrypted connections by default. For TLS configuration and certificate guidance, see Connect to Azure Database for MySQL using TLS.

If you use an on-premises data gateway, use standard mode and install Oracle MySQL Connector/NET on the gateway computer. This connector uses the underlying MySQL data provider. Follow the installation and provider verification instructions in MySQL connector prerequisites.

Supported capabilities

  • Import

Parameters

Entry point: AzureDatabaseForMySQL.Database

Required parameter count: 2

Connect to Azure Database for MySQL

Parameter Display name Required Type Sample values Nullable
server Server Yes text "azuremysql.mysql.database.azure.com:3306" false
database Database Yes text false

Connect from Power Query Online

To import data from an Azure Database for MySQL database:

  1. Open the get data experience in your application and select Azure Database for MySQL. Entry points vary by application; see Where to get data.
  2. Enter the Server and Database values. Both values are required. For example, enter contoso.mysql.database.azure.com:3306 for the server and the name of your existing database for the database.
  3. Select an existing connection for that server and database, or create a connection. If you use a gateway, select one that can reach the database and has the required MySQL data provider.
  4. For a new connection, select the username/password authentication option and enter your MySQL credentials. Use a database account, not the credentials you use to sign in to the Azure portal.
  5. Keep connection encryption enabled, and continue to connect to the database.
  6. In Navigator, select the tables you want to import, then select Transform data to open them in the Power Query editor.
  7. Apply the transformations you need, then save the query or dataflow using your application's workflow.

The connection identifies a specific server and database. When configuring refresh or reusing a connection, use the same server, port, and database values.

Connection troubleshooting

Symptom What to check
The server can't be reached, or the connection times out Check the server name, port, firewall rules, and network route from the service or selected gateway. For private access, also check private DNS resolution.
Authentication fails Confirm the database username and password with your administrator, and confirm that the account has access to the specified database. Signing in to Azure doesn't grant database access by itself.
The MySQL data provider isn't found on the gateway Install Oracle MySQL Connector/NET on the gateway computer and verify the provider installation using the MySQL prerequisite instructions.
The connection reports a TLS or certificate error Check the server's TLS requirements and the certificate trust configuration on the connecting computer or gateway. Use the Azure Database for MySQL TLS guidance rather than disabling encryption to bypass the error.
Expected tables aren't available Verify the database name and the account's permissions to read those tables.

Choosing the connector

The Azure Database for MySQL entry described here accepts server and database parameters. For the MySQL database connector in Power BI Desktop or Excel, including its provider installation and advanced options, use the separate MySQL database connector guide. Options documented for MySQL.Database aren't additional parameters of AzureDatabaseForMySQL.Database.