October 10th, 2012, 07:22 PM
Connect to remote server
I am trying to connect to a remote MS SQL 2008 server with:
and I receive the message
$link = mysql_connect('10.1.1.16:1433', 'ID', 'password');
die('Could not connect: ' . mysql_error());
The php error log shows:
I also tried port 3306 but that produced a
What am I missing here?
[10-Oct-2012 20:02:47] PHP Warning: mysql_connect(): Error while reading greeting packet. PID=61066 in /home/epanagio/play/remote_connect.php on line 2 [10-Oct-2012 20:02:47] PHP Warning: mysql_connect(): MySQL server has gone away in /home/epanagio/play/remote_connect.php on line 2
October 10th, 2012, 07:57 PM
You're trying to use the drivers for mysql to connect to a mssql server. That won't work. You need to use the mssql drivers.
It is a truism of American politics that no man who can win an election deserves to. --Trevanian, from the novel Shibumi
October 10th, 2012, 08:37 PM
I changed it to:
and I receive a
$link = mssql_connect('10.1.1.16:1433', 'ID', 'password');
in the php error log. I have installed something called freetds that makes the connection "easier." In the /usr/ports/databases/freetds/work/freetds-0.64/freetds.conf I have specified:
but it doesn't connect.
PHP Warning: mssql_connect(): Unable to connect to server: 10.1.1.16:1433 in /home/epanagio/play/remote_connect.php on line 2
Last edited by epanagio; October 10th, 2012 at 08:45 PM.