cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
jellek Frequent Visitor
Frequent Visitor

Cannot Connect to MySQL on Linux VM

Hi there,

I have a Virtual Machine running a LAMP server with a bridged connection to the host computer (Win10).

 

After installing Mmysql-connector-net-6.6.5.msi I still cannot connect to my database; utilities. 
I can access the database through phpMyAdmin, 192.168.0.13 on host computer.
If I check in phpMyAdmin, the port is 3306, I also tried Ubuntu which is listed as the Hostname in phpMyAdmin.

 

In Power BI i get the following error:
"Details: "MySQL: Unable to connect to any of the specified MySQL hosts.""

 

Why can I not connect to my Database? what am I doing wrong? Is this a firewall issue?


I'm still new to virtual machines and LAMP, so if you could point me in the right direction then that would be great.

Thanks in advance.
Jelle

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator v-qiuyu-msft
Moderator

Re: Cannot Connect to MySQL on Linux VM

Hi @jellek,

 

In your scenario, I would suggest you check if you can use MySQL workbench to the database successfully. Make sure that MySQL workbench is installed  on the same machine with Power BI Desktop. If the connection fails, please follow the instructions in this blog to troubleshoot this issue.

 

If you are able to connect to database using MySQL workbench, please use same connection parameters in Power BI Desktop, and also add port number with server name to connect to MySQL.

 

Also ensure that you install MySQL Connector/Net 6.6.5 for Microsoft Windows on your computer. Select the driver that matches your Power BI Desktop installation (32-bit or 64-bit).

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Moderator v-qiuyu-msft
Moderator

Re: Cannot Connect to MySQL on Linux VM

Hi @jellek,

 

In your scenario, I would suggest you check if you can use MySQL workbench to the database successfully. Make sure that MySQL workbench is installed  on the same machine with Power BI Desktop. If the connection fails, please follow the instructions in this blog to troubleshoot this issue.

 

If you are able to connect to database using MySQL workbench, please use same connection parameters in Power BI Desktop, and also add port number with server name to connect to MySQL.

 

Also ensure that you install MySQL Connector/Net 6.6.5 for Microsoft Windows on your computer. Select the driver that matches your Power BI Desktop installation (32-bit or 64-bit).

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

jellek Frequent Visitor
Frequent Visitor

Re: Cannot Connect to MySQL on Linux VM

Thanks a lot for your help Qiuyun Yu, you pointed me in the right direction.

There were a few things I had to do on both my host and in guest MySQL database:

 

1) I opened the correct port number on my windows host.

2) GRANT ALL ON *.* to homedbuser@localhost IDENTIFIED BY 'password'; for my user in MySQL

3) in mysqld.cnf file i changed the bind-address = 0.0.0.0

 

After all these changes I tested the connection and it worked.

 

Time to visulize my data.

 

dlash Frequent Visitor
Frequent Visitor

Re: Cannot Connect to MySQL on Linux VM

Does this work? The mysql credentals page does not even support a port number? 

Are you sure you can connect to a remote mysql DB running off a linux server? It doesn't look supported. 

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Top Kudoed Authors
Users Online
Currently online: 340 members 3,183 guests
Please welcome our newest community members: