How can I find sql server port number from windows registry?

坚强是说给别人听的谎言 提交于 2019-11-30 18:52:05
Martin

SQL Server 2000

Default instance

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\SuperSocketNetLib\TCP

Named instance

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\(InstanceName)\MSSQLServer\SuperSocketNetLib\TCP

SQL Server 2005

There is no distinction between default and named instances. An instance is assigned a number based on the order it was installed. We first need to locate the registry key for the instance, which looks like

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.#

'#' is the number assigned to the instance. The instance name is stored as the default value for this registry key. For a default instance, it is MSSQLSERVER.

Once the registry key for the instance is found, we know the TCP/IP registry key is

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.#\MSSQLServer\SuperSocketNetLib\TCP\IPAll

SQL Server 2008

Default instance

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQLServer\SuperSocketNetLib\TCP\IPAll

Named instance

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.(InstanceName)\MSSQLServer\SuperSocketNetLib\TCP\IPAll

More information here.

You can also find the port in the SQL Server Configuration Manager:

  • Select Protocols for SQL2008 under SQL server Network Configuration
  • Right click "TCP/IP" -> select Properties
  • Select the IP Addresses-tab
  • In the section IP ALL, you should see the ports

i'm not sure correct or not, u can use the Server Network Utility from the server and click Properties in TCP/IP for Enabled protocols list.

or can also check the port number an instance of SQL Server in the error log i.e. 10.0.0.1: 3306, the last 4 digit no after colon is the SQL server listening for the ip add

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