Connecting to MySQL VM remotely (Azure Resource Manager)
-
01-10-2020 - |
سؤال
I have a VM setup in Azure (running Windows Server 2012 R2) with MySQL 5.7 installed. I am trying to access this using MySQL Workbench - which when running on the server works perfectly.
However, trying to use Workbench from my own PC is giving me there error "10060":
I have also tried doing this using a PHP file in an Azure web app to connect, again not working.
I have set the following:
- Azure Security Group, inbound port 3306 is open
- On the server the following inbound port rules have been applied:
- User is set to stackexchange@% (i.e. not localhost)
Is there something I have missed? Do I need to allow the database to have remote connections?
Apologises if this is the wrong site. Wasn't sure if it was server related or related to the DB itself.
There is this tutorial by Microsoft but it uses the classic deployment model - not Resource Manager. And questions like this on here don't cover MySQL specifically.
المحلول
After a bit of head banging I have found that changing the bind-address
on mysql to the ip address of the node connecting to mysql makes mysql
refuse to restart
So instead set the bind-address = 0.0.0.0
Then let the firewall and mysql handle allowing the hsot.
Create a firewall rule on the mysql node like below:
Then create a remote mysql user limiting the host to the internal/private ip address above.
نصائح أخرى
In case anyone else comes across this, in the end I never resolved this issue properly. I ended up resorting to setting up a new VM in the classic model and using that instead - which was actually very easy.