Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
murugesh_c
Frequent Visitor

MySQl queries in Power BI - Connection must be valid and open error

Hello everyone,

 

I am trying to import data through MySQL queries. The query has Select, Inner Join, Left Join and Where clause. When I refresh, the query runs very slow and fetches less than 2000 records in a minute and after 10-12 minutes I am getting the below error.

murugesh_c_0-1690204375993.png

 

I have connected to the server through VPN and the connection is stable only. Following by the above error message, the below load window show like this.

 

murugesh_c_1-1690204467871.png

 

I tried many options and going clueless how to fix this one. Can any of you help me with the solution?

 

Thanks

 

1 ACCEPTED SOLUTION
rubayatyasmin
Super User
Super User

Hi, @murugesh_c 

 

Your error typically means the connection to your MySQL server is being disrupted. This can be due to:

  1. Network instability, even with a VPN
  2. MySQL Server timeout (set by wait_timeout)
  3. Resource limitation on your server or local machine.

Possible solutions include:

  1. Optimizing your query to fetch less data or process faster
  2. Increasing MySQL wait_timeout
  3. Checking your VPN settings for timeouts
  4. Monitoring and improving system resource usage.

if these doesn't help, try creating the connection from the scratch. 

 

refer: https://community.fabric.microsoft.com/t5/Desktop/Power-BI-MySQL-Unexpected-error-Connection-must-be...

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


View solution in original post

3 REPLIES 3
v-yanjiang-msft
Community Support
Community Support

Hi @murugesh_c ,

Does your problem solved by @rubayatyasmin 's solution? If so, please kindly accept the helpful reply as solution. Otherwise you can try the following suggestion:

  • The MySQL Connector/NET package is not installed or not compatible with Power BI. You need to install version 8.0.26 of this package on your machine and on the gateway machine if you are using one.
  • The connection is not encrypted and Power BI is trying to use an encrypted connection. You need to clear the Use Encrypted Connection option in the MySQL database dialog.
  • The query is too complex or contains unsupported statements such as INSERT. You need to simplify the query or use only SELECT statements in Power BI.

Best regards,

Community Support Team_yanjiang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

rubayatyasmin
Super User
Super User

Hi, @murugesh_c 

 

Your error typically means the connection to your MySQL server is being disrupted. This can be due to:

  1. Network instability, even with a VPN
  2. MySQL Server timeout (set by wait_timeout)
  3. Resource limitation on your server or local machine.

Possible solutions include:

  1. Optimizing your query to fetch less data or process faster
  2. Increasing MySQL wait_timeout
  3. Checking your VPN settings for timeouts
  4. Monitoring and improving system resource usage.

if these doesn't help, try creating the connection from the scratch. 

 

refer: https://community.fabric.microsoft.com/t5/Desktop/Power-BI-MySQL-Unexpected-error-Connection-must-be...

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


In addition to @rubys solution, I set the Command timeout to 90 minutes while importing data as shown in the screenshot below. 

 

murugesh_c_0-1690524550004.png

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Solution Authors