Home > Common Problem > body text

How to check the sqlserver database port number

下次还敢
Release: 2024-04-05 21:51:21
Original
616 people have browsed it

The port number of the SQL Server database can be queried through the following steps: connect to the database server and execute the query SELECT @@SERVERPORT; run the query, and the port number is displayed in the result grid.

How to check the sqlserver database port number

SQL Server database port number query method

Query method:

Query the port number of the SQL Server database through the following steps:

Step 1: Connect to the database server

  • Open SQL Server Management Studio (SSMS) .
  • Connect to the database server to be queried.

Step 2: Execute the query

  • In SSMS, click New Query.
  • In the query editor, enter the following query:
<code class="sql">SELECT @@SERVERPORT;</code>
Copy after login

Step 3: Run the query

  • Click Execute ” button (or press F5).

Query results:

The query will return the port number of the current database server. You will see the port number in the results grid.

Other methods:

In addition to using SSMS query, there are other methods to find the port number of the SQL Server database:

  • TCP Configuration Utility (TCPConfig.exe): You can run this utility from a command prompt to view all registered TCP ports.
  • Netstat Command: Use the command netstat -an and then look for the port with the SQL Server process.
  • System Registry: The port number is stored in the following key in the Windows Registry:
<code>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.<InstanceName>\MSSQLServer</code>
Copy after login

where <InstanceName> is The name of the SQL Server instance.

Please note that the default SQL Server port number is 1433, but it can be configured to a different value.

The above is the detailed content of How to check the sqlserver database port number. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!