别名不适用于 sql server 2008 r2
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6406811/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
alias not working on sql server 2008 r2
提问by Saba
I have several servers with SQL Server 2008 R2 instances on them, and alias doesn't work on any of them.
我有几台带有 SQL Server 2008 R2 实例的服务器,别名在其中任何一个上都不起作用。
Clients connect to these servers using TCP/IP without any problem, telnet works on IP/Port I use for my alias, the firewall exceptions are created, basically everything works fine, except when I create an alias, I can not connect through it to my server using either TCP/IP or named pipes (local or one of other servers).
客户端使用 TCP/IP 连接到这些服务器没有任何问题,telnet 在我用作别名的 IP/端口上工作,创建了防火墙例外,基本上一切正常,除非我创建别名时,我无法通过它连接到我的服务器使用 TCP/IP 或命名管道(本地或其他服务器之一)。
I've installed latest cumulative updates, which updates native client too (which I think is the source of problem) and I still have the problem. The stranger part is, if I create an alias on a server with sql server 2005 (native client 9), I can connect to my 2008 r2 instances. Any suggestions?
我已经安装了最新的累积更新,它也更新了本机客户端(我认为这是问题的根源),但我仍然有问题。奇怪的是,如果我在带有 sql server 2005(本机客户端 9)的服务器上创建别名,我可以连接到我的 2008 r2 实例。有什么建议?
回答by m1k4
After you are sure, that it's not firewall problem, TCP/IP problem, and you can connect to server regularly without using alias and only have a problem to connect with alias, I have this problem on Vista and Windows 7.
在您确定不是防火墙问题、TCP/IP 问题,并且您可以在不使用别名的情况下定期连接到服务器后,只有使用别名连接有问题,我在 Vista 和 Windows 7 上都有这个问题。
Solution is to set up proper port inside of "SQL Server Network Configuration" inside "SQL Server Configuration Manager".
解决方案是在“SQL Server 配置管理器”中的“SQL Server 网络配置”中设置适当的端口。
Here are the steps:
以下是步骤:
Go to Computer Management -> Service and Application -> SQL Server Configuration Manager -> SQL Server Network Configuration
转到计算机管理 -> 服务和应用程序 -> SQL Server 配置管理器 -> SQL Server 网络配置
Notice that you can also open directly SQL Server Configuration Manager (not from Computer management)
请注意,您也可以直接打开 SQL Server 配置管理器(不是从计算机管理)
Then in SQL Server Network Configuration, if it is not already enabled, enable TCP/IP protocol.
然后在 SQL Server 网络配置中,如果尚未启用,请启用 TCP/IP 协议。
Right click to open properties of TCP/IP protocol
右键单击打开 TCP/IP 协议的属性
Then on IP Adresses Tab you will have couple of records.
然后在 IP 地址选项卡上,您将有几条记录。
For every one put TCP Port = 1433
对于每一个 put TCP Port = 1433
If you use x64 operating system, you have two "SQL Server Network Configuration" nodes, one for 32bit and the other for 64bit. Be sure that you have checked those port on both of them.
如果使用 x64 操作系统,则有两个“SQL Server 网络配置”节点,一个用于 32 位,另一个用于 64 位。确保您已经检查了它们两个上的那些端口。
Good luck
祝你好运
回答by Tom Brown
For me it was the sequence of creating the aliases that was important. See this link: W2K8 R2 SQL Alias will not connectI started by deleting everything, CliConfig aliases and Configuration Manager Native Client config aliases. Then re-create, adding the CLICONFG version first.
对我来说,重要的是创建别名的顺序。请参阅此链接:W2K8 R2 SQL 别名将无法连接我通过删除所有内容、CliConfig 别名和 Configuration Manager Native Client 配置别名开始。然后重新创建,先添加 CLICONFG 版本。
run CLICONFG - create your TCP alias (will default to the x64 version if you're on a 64-bit O/S)
From SQL Server Configuration Manager create the alias under "SQL Native Client 10.0 configuration"
运行 CLICONFG - 创建您的 TCP 别名(如果您使用的是 64 位操作系统,则默认为 x64 版本)
从 SQL Server 配置管理器在“SQL Native Client 10.0 配置”下创建别名
Try to connect using SSMS - it worked for me. If it doesn't you could go on to try the 32-bit set-up. I did this anyway as the application I'm developing which uses the alias is x86.
尝试使用 SSMS 进行连接 - 它对我有用。如果没有,您可以继续尝试 32 位设置。无论如何,我都这样做了,因为我正在开发的使用别名的应用程序是 x86。
- %SystemRoot%/SysWow64/CliConfg.exe (32-bit version on 64-bit O/S)
- "SQL Native Client 10.0 Configuration (32bit)" under the configuration manager tool.
- %SystemRoot%/SysWow64/CliConfg.exe(64 位操作系统上的 32 位版本)
- 配置管理器工具下的“SQL Native Client 10.0 Configuration (32bit)”。
回答by datawrangler
For me, the answer was to use the 32-bit CLICONFG. Both Management Studio and the application I was trying to install were 32-bit applications on a 64-bit server. Moral of the story is to create both 64-bit and 32-bit aliases.
对我来说,答案是使用 32 位 CLICONFG。Management Studio 和我尝试安装的应用程序都是 64 位服务器上的 32 位应用程序。这个故事的寓意是创建 64 位和 32 位别名。
回答by SPE109
Are you using named instances? And if so have you checked that the port is statically assigned?
你在使用命名实例吗?如果是这样,您是否检查过端口是静态分配的?
If you are using default instances are you running on a x64 platform? There are aliases for 32bit and 64bit so SSMS on the same box as the database engine would use the alias under the 32 bit section even though the box is 64bit
如果您使用默认实例,您是否在 x64 平台上运行?有 32 位和 64 位的别名,因此与数据库引擎在同一个机器上的 SSMS 将使用 32 位部分下的别名,即使该机器是 64 位
回答by Yves
Try it with the IP address, like 127.0.0.1 instead of your machine name, localhost or .(dot).
尝试使用 IP 地址,例如 127.0.0.1,而不是您的机器名称、localhost 或 .(dot)。
回答by Alan Macdonald
For me this was caused by me creating the alias on a 64 bit machine but the software running as a 32 bit application.
对我来说,这是因为我在 64 位机器上创建了别名,但软件作为 32 位应用程序运行。
When in Sql Server Configuration Managerensure the alias is set under boththe following sections:
当在Sql Server 配置管理器中时,确保在以下两个部分下设置别名:
- SQL Native Client {VersionNo}Configuration
- SQL Native Client {versionNo} Configuration (32bit)
- SQL Native Client {VersionNo}配置
- SQL Native Client {versionNo} 配置(32bit)
That way it will be available regardless of processor platform. Of course if you only want the alias available for one platform for some reason, set the appropriate one and not the other.
这样,无论处理器平台如何,它都可以使用。当然,如果您出于某种原因只希望别名可用于一个平台,请设置适当的一个而不是另一个。
回答by Jorge Cribb
In my case it only worked when I placed the port on the connection [server]\[instance],[port]. Example: DBSERVER\OPERATIONS,1433
就我而言,它仅在我将端口放置在连接[server]\[instance],[port]上时才起作用。示例:DBSERVER\OPERATIONS,1433
回答by Scott Brickey
Also, check that your alias uses listeners that are enabled (is your alias configured to use TCP while your server is only listening via Shared Memory?)
此外,请检查您的别名是否使用已启用的侦听器(您的别名是否配置为使用 TCP,而您的服务器仅通过共享内存进行侦听?)