|
| 1 | +--- |
| 2 | +title: Connect Azure Database for MySQL Flexible Server with Power BI |
| 3 | +description: This topic shows how to build Power BI reports from data on your Azure Database for MySQL Flexible Server. |
| 4 | +ms.service: mysql |
| 5 | +ms.subservice: flexible-server |
| 6 | +ms.topic: quickstart |
| 7 | +author: mksuni |
| 8 | +ms.author: sumuth |
| 9 | +ms.date: 09/01/2022 |
| 10 | +--- |
| 11 | + |
| 12 | +# Import data from Azure Database for MySQL Flexible Server in Power BI |
| 13 | + |
| 14 | +>[!NOTE] |
| 15 | +> This article applies to Power BI Desktop only. Currently Power Query online or Power BI Service is **not supported**. |
| 16 | +
|
| 17 | +With Power BI Desktop you can visually explore your data through a free-form drag-and-drop canvas, a broad range of modern data visualizations, and an easy-to-use report authoring experiences. You can import directly from the tables or import from a SELECT query. In this quickstart you will learn how to connect with Azure Database for MySQL Flexible Server with Power BI Desktop. |
| 18 | + |
| 19 | +## Prerequisites |
| 20 | + |
| 21 | +1. Install [Power BI desktop](https://aka.ms/pbidesktopstore). |
| 22 | +2. If you connect with MySQL database for the first time in Power BI, you need to install the Oracle [MySQL Connector/NET](https://dev.mysql.com/downloads/connector/net/) package. |
| 23 | +3. Skip the steps below if MySQL server has SSL disabled. If SSL is enabled then follow the steps below to install the certificate. |
| 24 | + 1. Download the [SSL public certificate](https://dl.cacerts.digicert.com/DigiCertGlobalRootCA.crt.pem). |
| 25 | + 2. Install the SSL certificate in Trusted Root certification authorities store by following these steps: |
| 26 | + 1. Start **certmgr.msc** Management Console on your Windows system. |
| 27 | + 2. Right-click **Trusted Root Certification Authorities** and select **Import**. |
| 28 | + 3. Follow the prompts in the wizard to import the root certificate (for example, DigiCertGlobalRootCA.crt.pem) and click OK. |
| 29 | + |
| 30 | +## Get MySQL server information |
| 31 | + |
| 32 | +Get the connection information needed to connect to the Azure Database for MySQL Flexible Server. You need the fully qualified server name and sign in credentials. |
| 33 | + |
| 34 | +1. Sign in to the [Azure portal](https://portal.azure.com/). |
| 35 | +2. From the left-hand menu in Azure portal, select **All resources**, and then search for the server you have created (such as **mydemoserver**). |
| 36 | +3. Select the server name. |
| 37 | +4. From the server's **Overview** panel, make a note of the **Server name** and **Server admin login name**. If you forget your password, you can also reset the password from this panel. |
| 38 | +5. Go to **Databases** page to find the database you want to connect to. Power BI desktop supports adding a connection to a single database and hence providing a database name is required for importing data. |
| 39 | + |
| 40 | +## Connect to MySQL database from Power Query Desktop |
| 41 | + |
| 42 | +To make the connection, take the following steps: |
| 43 | + |
| 44 | +1. Select the **MySQL database** option in the connector selection. |
| 45 | + |
| 46 | +:::image type="content" source="./media/connect-with-powerbi-desktop/add-mysql-connection.png" alt-text="Screenshot of adding a mysql connection in power BI."::: |
| 47 | + |
| 48 | +3. In the **MySQL database** dialog, provide the name of the server and database. |
| 49 | + |
| 50 | + :::image type="content" source="./media/connect-with-powerbi-desktop/signin.png" alt-text="Screeshot of Signing in to Power BI."::: |
| 51 | + |
| 52 | +3. Select the **Database** authentication type and input your MySQL credentials in the **User name** and **Password** boxes. Make sure to select the level to apply your credentials to. |
| 53 | + |
| 54 | + :::image type="content" source="./media/connect-with-powerbi-desktop/enter-credentials.png" alt-text="Screenshot of entering credentials to connect with MySQL database."::: |
| 55 | + |
| 56 | +4. Once you're done, select **OK**. |
| 57 | + |
| 58 | +5. In **Navigator**, select the data you require, then either load or transform the data. |
| 59 | + |
| 60 | + :::image type="content" source="./media/connect-with-powerbi-desktop/navigator.png" alt-text="Screenshot of navigator to view MySQL tables."::: |
| 61 | + |
| 62 | +## Connect to MySQL database from Power Query Online |
| 63 | + |
| 64 | +To make the connection, take the following steps: |
| 65 | + |
| 66 | +1. Select the **MySQL database** option in the connector selection. |
| 67 | + |
| 68 | +2. In the **MySQL database** dialog, provide the name of the server and database. |
| 69 | + |
| 70 | + :::image type="content" source="./media/connect-with-powerbi-desktop/mysql-advanced-options.png" alt-text="Screenshot of MySQL advanced options."::: |
| 71 | + |
| 72 | +3. If necessary, include the name of your on-premises data gateway. |
| 73 | + |
| 74 | +4. Select the **Basic** authentication kind and input your MySQL credentials in the **Username** and **Password** boxes. |
| 75 | + |
| 76 | +5. If your connection isn't encrypted, clear **Use Encrypted Connection**. |
| 77 | + |
| 78 | +5. Select **Next** to connect to the database. |
| 79 | + |
| 80 | +6. In **Navigator**, select the data you require, then select **Transform data** to transform the data in Power Query Editor. |
| 81 | + |
| 82 | +## Connect using advanced options |
| 83 | + |
| 84 | +Power Query Desktop provides a set of advanced options that you can add to your query if needed. The following table lists all of the advanced options you can set in Power Query Desktop. |
| 85 | + |
| 86 | +| Advanced option | Description | |
| 87 | +| --------------- | ----------- | |
| 88 | +| Command timeout in minutes | If your connection lasts longer than 10 minutes (the default timeout), you can enter another value in minutes to keep the connection open longer. This option is only available in Power Query Desktop. | |
| 89 | +| SQL statement | For information, go to [Import data from a database using native database query](/power-query/native-database-query). | |
| 90 | +| Include relationship columns | If checked, includes columns that might have relationships to other tables. If this box is cleared, you won’t see those columns. | |
| 91 | +| Navigate using full hierarchy | If checked, the navigator displays the complete hierarchy of tables in the database you're connecting to. If cleared, the navigator displays only the tables whose columns and rows contain data. | |
| 92 | + |
| 93 | +Once you've selected the advanced options you require, select **OK** in Power Query Desktop to connect to your MySQL database. |
| 94 | + |
| 95 | +## Next steps |
| 96 | +[Build visuals with Power BI Desktop](/power-bi/fundamentals/desktop-what-is-desktop) |
| 97 | + |
0 commit comments