Access SQL Server on Azure VM via SQL Server Management Studio on my local Machine

旧时模样 提交于 2019-12-10 03:14:11

问题


I'm sure this is out there somewhere but I can't find it and my brain hurts.

I have a VM on Azure. It has SQL Server running on it. I can access it locally on the VM no problem but I would like to manage it from my dev computer via SQL Server Management Studio.

Is this possible and what creds would I use? the VM Login?

Thanks, R


回答1:


You need to complete all of the following to achieve what you want:

  • Add a TCP endpoint for that VM on port 1433 - public & private (you can change the public port if you will).
  • Configure the SQL Server Instance to listen to TCP.
  • Enable the incomping TCP port 1433 in the local FireWall rules of the VM.
  • Enable mixed mode authentication on the SQL Server
  • Make sure your ISP does not block outgoing port 1433 (a common practice for most of ISVs since 2003' SQL Slammer) - this is overridable with custom Public port for your TCP endpoint.

Than you will be able to connect to the SQL Server in the Azure VM using your local SSMS.




回答2:


Faced this issue with Azure VM, I can't connect to SQL server. Completed all steps described in answer above but didn't get success..

It started to work when I set specific port for TCP/IP protocol.

So open SQL Server Configuration Manager, find TCP/IP protocol for your instance, open Properties and set port to 1433 in IPAll section.




回答3:


I had the same problem, what I should change was: click on the VM in AzurePortal --> SQL Server configuration --> Change SQL Connectivity to public

then it works for me!




回答4:


Instead of SSMS you can also use Powershell to check connectivity with SQL server on Azure VM. The detailed powershell script is at the following link -

http://sanganakauthority.blogspot.in/2014/02/connecting-to-sql-server-virtual.html

This saves you from the installation of SSMS on the machine from which you wih to connect to SQL server virtual machine.



来源:https://stackoverflow.com/questions/12202811/access-sql-server-on-azure-vm-via-sql-server-management-studio-on-my-local-machi

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