SQL Server 2012 1326 Error

Source: Internet
Author: User
Tags change settings microsoft sql server management studio sql server management sql server management studio server port

MSSQLServer cannot error:1326 error resolution for remote database

Create a remote (code) connection account when you use and configure MSSQL 2012 at a time. Discovery is never connected. and has always reported error 1326 errors. According to many methods on the internet still cannot solve. When configuring firewall rules during troubleshooting, think of what Windows program ports should look like under the cmd command line. Based on this idea, there is a problem finding the SQL Server port.


650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/7D/6A/wKioL1bn4Qjyx29WAABuAauVlzA782.png "title=" 20160315181323.png "alt=" Wkiol1bn4qjyx29waabuaauvlza782.png "/>

Change the dynamic port in the picture and make sure it succeeds. (To fix a specific access port)

If you are still not connected, you can refer to other methods on the Internet

Step one: Ensure that the server-side database service has started
start All Programs->microsoft SQL Server 2008->configutation Tools, open SQL Server Configuration Manager, click SQL Server Serv ICES, check to see if the database service is started and start it manually if the service is not turned on. Of course, you can also check to see if the appropriate database service is started by tapping services, manager tools, Control Panel, Windows. Or if the server is on the same network as your machine, you can also view all available SQL Server servers in the network by command "Sqlcmd-l" (note L to capitalize).

Step two: Enable TCP/IP
Multiple SQL Server servers that communicate with each other through the network require TCP/IP support, so that the SQL Server server can be connected remotely must ensure that TCP/IP is enabled. Follow the steps that are described earlier, open SQL Server Configuration Manager, open the SQL Server Network configuration, select the database you want to set up, and then click TCP/IP, and then right-enable. If necessary, you can also enable named Pipes. Remember, all modifications must be restarted before the SQL Server service can take effect!

Step Three: Open the port number of SQL Server in Windows Firewall
many times we do not successfully establish a remote connection after the database server itself has been set up many times, it is necessary to consider whether it is a firewall in mischief. By default, many port numbers and services are blocked by firewalls and cannot be accessed or executed remotely, and SQL Server's default port number is no exception. We should reset Windows Firewall to add an exception to SQL Server. Unless it is artificially modified, the port number of SQL Server is 1433 by default, and the port number is added to the Windows Firewall. If a named instance exists in SQL Server, you should also add SQL Server Browser to Windows Firewall. (a named instance of SQL Server will be described later)
Open the Windows Control Panel, select Windows Firewall->change settings->exceptions->add Port

Click Add Port ... In the popup dialog box, fill in the following:
Name:sql
Port number:1433
Protocol:select TCP

Fourth step: Enable remote connections in SQL Server Manager

in the window that opens, select connections on the left, and then tick "Allow remote connections to this server".

Fifth step: Enable SQL Server Browser service
If SQL Server is not using the default instance name for the installation, but a custom instance name, and no specific TCP/IP port number is configured, then as we described earlier, SQL Server still cannot support remote connections. However, if you enable the SQL Server Browser service, you can make a remote SQL Server connection through the dynamic TCP/IP port number. Enabling the SQL Server Browser service is simple, similar to enabling SQL Server, right-clicking SQL Server Browser in SQL Server Configuration Manager and selecting Enable. Enabling this service will affect all installed instances of SQL Server on the server.

Sixth step: Create an exception for the Sqlbrowser.exe application in the firewall

As we mentioned earlier, custom named SQL Server instances to support remote connections require the SQLBrowser service to be enabled, and Windows Firewall may prevent the service from executing. Therefore, we must add an exception to the SQLBrowser service in Windows Firewall.
First find the path to the server where the Sqlbrowser.exe program is installed, such as C:\Program Files\Microsoft SQL Server\90\shared\sqlbrowser.exe. If you are not sure where SQL Server is installed, you can search for the file name in Windows. Similar to the method we described earlier in adding SQL TCP/IP port numbers to the firewall, add a firewall exception to the Sqlbrowser.exe application.

Last: Re-create the database alias
Creating a SQL Server alias and using it in your application is common. Using a database alias ensures that the database connection string in the application does not have to be modified once the location of the database has changed, such as when a new server has been replaced, the IP address has changed, and so on. Otherwise, if you change the location of the database, you also need to notify all applications that use the database to modify the connection string in the source code or configuration file, which is probably not possible. Therefore, it is a very wise choice to use a database alias to configure the connection string. In addition, you can use the same alias to point to different DB instances, and when you modify the alias parameters, you can switch between the databases immediately. Creating a database alias is as simple as selecting aliases in SQL Server Configuration Manager to create it.  



This article comes from the "behind the Scenes ops" blog, so be sure to keep this source http://haowen.blog.51cto.com/3486731/1751440

SQL Server 2012 1326 Error

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.