Академический Документы
Профессиональный Документы
Культура Документы
org/sql-server-2012-express-and-remote-connections/
Obavezno koristi ovo oznaeno crvenom, ovo ostalo samo ako je potrebno!!!
Obavezno koristi statiki port 1433.
1) Enable the TCP/IP protocol for the instance
Start the SQL Server Configuration Manager. On Windows 2012 you probably will not have a
shortcut to start the configuration manager. So open a cmd/powershell and start the configuration
manager with sqlservermanager11.
Expand SQL Server Network Configuration and select the Protocols for SQLEXPRESS item for
the particular instance you are configuring. Select TCP/IP, right-click (or choose action from the
menu) and select enable.
2) Choose to use dynamic ports or a static port
The default is to use dynamic ports.
If you would like to use a static port (like the familiar 1433 port), expand SQL Server Network
Configuration and select the Protocols for SQLEXPRESS item:
If you want to use dynamic ports you will need the SQL Server Browser service running. This
service is disabled by default.
Enabling the service with PowerShell:
set-service -Name SQLBrowser -StartupType Automatic
start-service -Name SQLBrowser
or with the commandline front-end to the Service Control Manager called sc.exe:
sc.exe config SQLBrowser start=auto
sc.exe start SQLBrowser
You can disable the firewall alltogether but this is not best practice. You can allow SQL server
and browser processes to receive data through the firewall by adding two firewall rules.
First find the path to the SQL server and browser executables. You can double-click their
corresponding services in services.msc and take note of the Path to executable.
Another way to find the path to the executables is by using sc.exe. Start by issueing a sc.exe
query and grabbing everything with Service and SQL in the output.
> sc.exe query|findstr SERVICE.*SQL
SERVICE_NAME: MSSQL$BES10
SERVICE_NAME: SQLBrowser
SERVICE_NAME: SQLWrite
We are only interested in the SQL server and SQL browser services. In my case the SQL server
instance is called BES10. Issue a sc.exe qc for the services you are interested in and take note of
the BINARY_PATH_NAME. Mind the single quotes when querying services with special
characters like $ in the name.
> sc.exe qc 'MSSQL$BES10'
In the above example I added the rules to the Domain profile. If you want to add the rule to all
profiles just leave the profile option out.
4) Restart the SQL Server service