mysql command line client says can't connect to Azure Database for Mysql

纵然是瞬间 提交于 2019-12-11 06:17:24

问题


I was happily using mysql command line in my mac to connect Azure Database for MySql. But all of sudden it started throwing an error saying:

ERROR 2003 (HY000): Can't connect to MySQL server on 'XXXXXXXX.mysql.database.azure.com' (61)

I can see the the database instances is running alright, as I'm able to use the database from an application that is running in Azure.

Has anyone else experienced this?


回答1:


This problem occurred because the particular network i was connected to not allowing any such connections. Later when i tried from my usual network ( home / office )it got connected. I haven't made any changes in my Azure Db for MySql nor in my local machine, this proves that problem was with that particular network.




回答2:


It sounds like firewall rules were not setup for that specific network. Can you confirm by looking at this doc?

https://docs.microsoft.com/en-us/azure/mysql/concepts-firewall-rules

Basically, you can click "Add my IP" which would add your current network's Client IP. However, if the network you are on SNAT's out with multiple IP's, you would need to add the entire range from your networking team.

Thanks.

James



来源:https://stackoverflow.com/questions/50947481/mysql-command-line-client-says-cant-connect-to-azure-database-for-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!