Configure SQLServer2012 to allow remote connections

The solution in this article applies to Microsoft Sql Server 2008/2012/2012 r2/2014 version, hereinafter referred to as MSSQLSERVER.

MSSQL does not allow remote connections by default, and disables the sa account. If you want to use SSMS to connect to MSSQLSERVER on a remote server locally, you need to configure two parts:

  1. SQL SERVER MANAGEMENT STUDIO(SSMS)

  2. SQL SERVER Configuration Manager (SQL SERVER CONFIGURATION MANAGER-SSCM)

And it should be noted that if some places do not take effect, please restart the sql server (you can find it from SSCM or from system services). Here are the detailed steps:

STEP1. Open SSMS, use the Windows identity to connect to the database, after logging in, right-click and select "Properties"

Insert picture description here

STEP 2. Select "Security", select SQL SERVER and Windows authentication mode
Insert picture description here

STEP 3. Then select "Connect", check "Allow remote connection to this server", and then click the "OK" button.
Insert picture description here
Insert picture description here

STEP 4. Expand "Security"-"Login Name-"sa, right click and select "Properties"
Insert picture description here

STEP 5. In "General", change your own password. This is the password for your sa login.
Insert picture description here

STEP 6. In the "Status", enable sa login and click the "OK" button
Insert picture description here

STEP 7. Right-click the database server and select "Aspect"
Insert picture description here

STEP 8. Select "Server Configuration", find RemoteAccessEnabled, and set it to "True"
Insert picture description here

STEP 9. Restart the SQL SERVER service and exit the current connection. At this time, you should be able to log in with sa.
Insert picture description here
Insert picture description here

STEP 10. Configure SSCM, select "SQL SERVER Service" on the left, make sure that "SQL SERVER" and "SQL SERVER BROWER" on the right are running, select "Network Configuration", double-click TCP/IP, and make sure the status is "Enabled"
Insert picture description here

STEP 11. Make sure that TCP/IP is enabled in the Client. The default port is 1433 and you can modify it yourself. Non-default ports need to be explicitly specified in the connection string.
Insert picture description here

STEP 12. Restart the SQL SERVER service here again, and it should be ready to use. But it still cannot be used. Confirm the firewall port settings and add C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Binn\sqlservr.exe to the allowed list under the SQL SERVER installation directory.
Insert picture description here
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/cao919/article/details/102655970