Remote Mssql connection

Status
Not open for further replies.
Elite Diviner
Joined
Jun 11, 2010
Messages
417
Reaction score
62
Alright i think i almost got it working though. i used this to get mssql to allow the connection:



and here is my register scipt before i started editing it:

Code:
$mssql_server = "\SQLEXPRESS"; //MSSQL server name or IP
$mssql_username = ""; //MSSQL username
$mssql_password = ""; //MSSQL password
$mssql_account_db = "ACCOUNT_DBF"; //MSSQL account database name
$mssql_character_01_db = "CHARACTER_01_DBF"; //MSSQL character database name
$mssql_account_table = "account_tbl"; //MSSQL account table name
$mssql_username_column = "account"; //MSSQL username column in account table
$mssql_password_column = "password"; //MSSQL password column in account table
$hash = "sdfgsdfhhh"; //Hash code
$random_text_text = "123454"; //Random text they must enter to register
Code:
$con = mssql_connect("myip:1433","username","password"); 
//$mssql_server = "\SQLEXPRESS"; //MSSQL server name or IP
//$mssql_username = ""; //MSSQL username
//$mssql_password = ""; //MSSQL password
$mssql_account_db = "ACCOUNT_DBF"; //MSSQL account database name
$mssql_character_01_db = "CHARACTER_01_DBF"; //MSSQL character database name
$mssql_account_table = "account_tbl"; //MSSQL account table name
$mssql_username_column = "account"; //MSSQL username column in account table
$mssql_password_column = "password"; //MSSQL password column in account table
$hash = "sdfgsdfhhh"; //Hash code
$random_text_text = "123454"; //Random text they must enter to register
$random_text_text = "123454"; //Random text they must enter to register


I'm stuck on this part. do i use $con = mssql_connect("myip:1433","username","password");

or do keep the script the same and use:
$mssql_server = "\SQLEXPRESS"; //MSSQL server name or IP

cuz i see where it says IP >.>
 
im trying to move it to my webhost. I have the script working on the localhost where the server is hosted. I want to move it to my webhost and have mssql connect remotely its safer and more webhost site will always be up
 
well where the mssql is its windows server 2008 r2 : P and the webhost is hostgator. I did ask them about it they said that they allow remote mssql.
 
ok, I see. Make sure that the firewall is allowing incoming connections on port 1433 (unless you changed the default port).

In the php script, change the mssql_server variable to "IP(:port)\InstanceName"
the port number is optional, because it defaults to 1433. The instance name is whatever you named the SQL installation. If you went with the default instance, the name is "SQLEXPRESS"

If you're able to log into it from SQL Server Management Studio, it's easy to find the instance name.
It would be in one of the blurred areas on the left of my image.
Johnny - Remote Mssql connection - RaGEZONE Forums
 
Code:
$mssql_server = "xx.xxx.xxx.xxx:1433\SQLEXPRESS"; //MSSQL server name or IP
$mssql_username = "sa"; //MSSQL username
$mssql_password = "adfdfghjhfg"; //MSSQL password
$mssql_account_db = "ACCOUNT_DBF"; //MSSQL account database name
$mssql_character_01_db = "CHARACTER_01_DBF"; //MSSQL character database name
$mssql_account_table = "account_tbl"; //MSSQL account table name
$mssql_username_column = "account"; //MSSQL username column in account table
$mssql_password_column = "password"; //MSSQL password column in account table


i have the port open with those setting i know that mssql is setup to get the connection. am i missing something? ima so make a guide for this If i get this working :)
 
I am sure, but you just said it had to be like xxx.xxx.xxx.xxx(:1413) and Johnny just missed the () around the port number, not sure if that gives the problem.
Johnny said his host supported mssql external connections so it should support it.
 
I am sure, but you just said it had to be like xxx.xxx.xxx.xxx(:1413) and Johnny just missed the () around the port number, not sure if that gives the problem.
Johnny said his host supported mssql external connections so it should support it.

Oh, I guess I grazed over the part about MSSQL being supported.

And no, the () would only make it worse lol I put it in parenthesis because the port number is optional.

I got a couple more ideas though. Are you sure you got the SQL Instance Name (the name after the \ in those places in the image I posted) type PERFECTLY? Any slight difference, even in capitalization could be a problem.

Here's the other one. Are you sure you restarted the sql service after enabling remote connections?

Other than that, I believe we've gone over everything. Btw, if you put SQL Server Management Studio on your local computer (you can do so without having any SQL instances running, which would waste resources), then you can attempt to log into it to see if remote connections are truly enabled. If you can log in through there but not the website, then you might have some other problem.
 
Status
Not open for further replies.
Back