别名在 sql server 2008 r2 上不起作用
我有几台带有 SQL Server 2008 R2 实例的服务器,并且别名在其中任何一台上都不起作用。
客户端使用 TCP/IP 连接到这些服务器没有任何问题,telnet 在我用作别名的 IP/端口上工作,创建了防火墙例外,基本上一切正常,除了当我创建别名时,我无法通过它连接到我的服务器使用 TCP/IP 或命名管道(本地或其他服务器之一)。
我已经安装了最新的累积更新,它也更新了本机客户端(我认为这是问题的根源),但我仍然遇到问题。更奇怪的是,如果我在带有 sql server 2005(本机客户端 9)的服务器上创建别名,我可以连接到我的 2008 r2 实例。有什么建议吗?
I have several servers with SQL Server 2008 R2 instances on them, and alias doesn't work on any of them.
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).
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
您使用命名实例吗?如果是这样,您是否检查过该端口是否是静态分配的?
如果您使用默认实例,您是否在 x64 平台上运行? 32 位和 64 位有别名,因此数据库引擎所在同一机器上的 SSMS 会使用 32 位部分下的别名,即使该机器是 64 位
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
对我来说,这是由于我在 64 位计算机上创建别名但软件作为 32 位应用程序运行而引起的。
在Sql Server 配置管理器中时,确保在以下部分两个下设置别名:
这样,无论处理器平台如何,它都可用。当然,如果出于某种原因您只希望别名可用于一个平台,请设置适当的平台而不是另一个。
For me this was caused by me creating the alias on a 64 bit machine but the software running as a 32 bit application.
When in Sql Server Configuration Manager ensure the alias is set under both the following sections:
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.
尝试使用 IP 地址(如 127.0.0.1)代替您的计算机名称、localhost 或 .(点)。
Try it with the IP address, like 127.0.0.1 instead of your machine name, localhost or .(dot).
就我而言,只有当我将端口放在连接[服务器]\[实例],[端口]上时,它才起作用。示例:DBSERVER\OPERATIONS,1433
In my case it only worked when I placed the port on the connection [server]\[instance],[port]. Example: DBSERVER\OPERATIONS,1433
另外,检查您的别名是否使用已启用的侦听器(您的别名是否配置为使用 TCP,而您的服务器仅通过共享内存侦听?)
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/IP 问题,并且您可以在不使用别名的情况下定期连接到服务器并且仅在使用别名连接时出现问题后,我在 Vista 和 Windows 7 上遇到此问题。
解决方案是设置在“SQL Server 配置管理器”内的“SQL Server 网络配置”中设置正确的端口。
步骤如下:
转到“计算机管理”->“计算机管理”。服务与应用-> SQL Server 配置管理器 -> SQL Server 网络配置
请注意,您还可以直接打开 SQL Server 配置管理器(不是从计算机管理)
然后在 SQL Server 网络配置中,如果尚未启用,请启用 TCP/IP 协议。
右键单击打开 TCP/IP 协议的属性
然后在 IP 地址选项卡上您将有几条记录。
对于每一个设置 TCP Port = 1433
如果您使用 x64 操作系统,则您有两个“SQL Server 网络配置”节点,一个用于 32 位,另一个用于 64 位。请确保您已检查了两者上的这些端口。
祝你好运
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.
Solution is to set up proper port inside of "SQL Server Network Configuration" inside "SQL Server Configuration Manager".
Here are the steps:
Go to Computer Management -> Service and Application -> SQL Server Configuration Manager -> SQL Server Network Configuration
Notice that you can also open directly SQL Server Configuration Manager (not from Computer management)
Then in SQL Server Network Configuration, if it is not already enabled, enable TCP/IP protocol.
Right click to open properties of TCP/IP protocol
Then on IP Adresses Tab you will have couple of records.
For every one 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.
Good luck
对我来说,重要的是创建别名的顺序。请参阅此链接: W2K8 R2 SQL 别名将无法连接
我首先删除所有内容:CliConfig 别名和 Configuration Manager Native Client 配置别名。然后重新创建,先添加CLICONFG版本。
运行 CLICONFG - 创建 TCP 别名(默认为 x64
版本(如果您使用的是 64 位操作系统)
来自 SQL Server 配置
管理器在“SQL Native Client 10.0”下创建别名
配置”
尝试使用 SSMS 进行连接 - 它对我有用。如果不行,您可以继续尝试 32 位设置。无论如何,我都这样做了,因为我正在开发的应用程序使用别名是 x86。
配置管理器工具。
For me it was the sequence of creating the aliases that was important. See this link: W2K8 R2 SQL Alias will not connect
I started by deleting everything, CliConfig aliases and Configuration Manager Native Client config aliases. Then re-create, adding the CLICONFG version first.
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"
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.
configuration manager tool.
对我来说,答案是使用 32 位 CLICONFG。 Management Studio 和我尝试安装的应用程序都是 64 位服务器上的 32 位应用程序。这个故事的寓意是创建 64 位和 32 位别名。
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.