0

I am having issues connecting to a mssql server that is located on a network machine. I need to connect remotely through another domain example (abc.com) not on the network to access data. This domain runs mysql if that makes any difference. I am trying to access the mssql server through this php script:

 <?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:

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.

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? Where can I find it if not? I am not using the localhost 127.0.0.1

user975044
  • 375
  • 4
  • 11
  • 26
  • This question answers your question, http://stackoverflow.com/questions/1975780/sql-server-enable-remote-connections-without-ssms – Harsh Baid Oct 10 '11 at 19:24

1 Answers1

0

In short to successfully execute the 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.

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

Thanx

Harsh Baid
  • 7,199
  • 5
  • 48
  • 92