简体   繁体   English

远程mssql 2008连接问题

[英]remote mssql 2008 connection issue

I am having issues connecting to a mssql server that is located on a network machine. 我在连接到位于网络计算机上的mssql服务器时遇到问题。 I need to connect remotely through another domain example (abc.com) not on the network to access data. 我需要通过不在网络上的另一个域示例(abc.com)进行远程连接以访问数据。 This domain runs mysql if that makes any difference. 如果有任何区别,此域将运行mysql。 I am trying to access the mssql server through this php script: 我正在尝试通过以下php脚本访问mssql服务器:

 <?php

$server= 'ip address:port';
$user='user';
$password= 'pass';


$con = mssql_connect($server,$user,$password);
if (!$con)
  {
  die('Could not connect:' . mssql_get_last_message() );
  }
else{ echo 'connected';
}

I run this script through the shell on abc.com and I get: 我通过abc.com上的外壳运行此脚本,然后得到:

mssql_connect(): Unable to connect to server:

I have gone through several tutorials to enabling tcp/ip access through the sql server config manager as well as allowing the specific port through the firewall. 我已经完成了一些教程,以通过sql服务器配置管理器启用tcp / ip访问以及允许特定端口通过防火墙。

What are some other things I should try or steps I am missing here. 我还应该尝试其他哪些事情,或者我在这里缺少的步骤。

Also: the ip address I am using is the one I found in the sql server config manager-> protocols for SQLEXPRESS->tcp/ip_>ip addresses->IP2->ip adress it is the correct ip address? 另外:我正在使用的IP地址是我在sql server config manager-> SQLEXPRESS-> tcp / ip_> ip地址-> IP2-> ip地址中找到的IP地址,它是正确的IP地址吗? Where can I find it if not? 如果没有,我在哪里可以找到它? I am not using the localhost 127.0.0.1 我没有使用localhost 127.0.0.1

In short to successfully execute the cmd. 简而言之,要成功执行cmd。

config: (2 instances of SQL // SQL2005 + 2008 Express instance on the remote machine, which refuses to install Management Studio 2008. 1. Enable TCP/IP Protocol 2. Enable Named Piptes 3. started sqlcmd Utility with -s \\SQLEXPRESS to get the right sever-instance C:\\Program Files\\Microsoft SQL Server\\100\\Tools\\Binn 4. Go to SMSS and local sql instance properties -> Connections -> check "Allow remote connections to this server" and run this script. config :(远程计算机上的2个SQL // SQL2005 + 2008 Express实例,拒绝安装Management Studio2008。1.启用TCP / IP协议2.启用命名的点3.使用-s \\ SQLEXPRESS启动sqlcmd Utility来获得正确的服务器实例C:\\ Program Files \\ Microsoft SQL Server \\ 100 \\ Tools \\ Binn 4.转到SMSS和本地sql实例属性->连接->选中“允许与该服务器的远程连接”并运行此脚本。

EXEC sys.sp_configure N'remote access', N'1'
GO
RECONFIGURE WITH OVERRIDE
GO

Here the link for the info from Msdn: http://msdn.microsoft.com/en-us/library/ms162773.aspx http://msdn.microsoft.com/en-us/library/ms162816.aspx 这里是来自Msdn的信息链接: http : //msdn.microsoft.com/zh-cn/library/ms162773.aspx http://msdn.microsoft.com/zh-cn/library/ms162816.aspx

Thanx 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM