我在SQL Server配置管理器中设置了一个别名,它在本地机器上工作。但是,如果我尝试从远程计算机连接到它,则只有通过逗号明确设置端口号(例如FooServer\Apple,1433
),连接才会通过。远程连接SQL Server别名而不指定端口?
如果不指定端口号,我得到这个:
Cannot connect to FooServer\Apple.
ADDITIONAL INFORMATION:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)
所以我不知道是否有一种方法能够连接到使用别名的SQL Server实例,而不必明确设置端口?
顺便说一句,这是你的文章中的一个非常奇怪的东西:FooServer \ Apple,1433。如果端口真的是1433(默认端口),则不需要指定实例名称和端口;此外,当你指定端口时,实例名称只是IGNORED – sepupic
这就是为什么它很奇怪,它只有在指定端口时才起作用。 – Alex
如果你的电脑名称是FooServer,就足以说明这一点,FooServer – sepupic