PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 10th, 2012, 07:22 PM
epanagio's Avatar
epanagio epanagio is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2003
Posts: 660 epanagio User rank is Second Lieutenant (5000 - 10000 Reputation Level)epanagio User rank is Second Lieutenant (5000 - 10000 Reputation Level)epanagio User rank is Second Lieutenant (5000 - 10000 Reputation Level)epanagio User rank is Second Lieutenant (5000 - 10000 Reputation Level)epanagio User rank is Second Lieutenant (5000 - 10000 Reputation Level)epanagio User rank is Second Lieutenant (5000 - 10000 Reputation Level)epanagio User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 5 h 32 m 17 sec
Reputation Power: 94
Connect to remote server

I am trying to connect to a remote MS SQL 2008 server with:
PHP Code:
 $link mysql_connect('10.1.1.16:1433''ID''password'); 
if (!
$link
      die(
'Could not connect: ' mysql_error()); 
and I receive the message
Quote:
Could not connect: MySQL server has gone away
The php error log shows:
PHP Code:
[10-Oct-2012 20:02:47PHP Warning:  mysql_connect(): Error while reading greeting packetPID=61066 in /home/epanagio/play/remote_connect.php on line 2 [10-Oct-2012 20:02:47PHP Warning:  mysql_connect(): MySQL server has gone away in /home/epanagio/play/remote_connect.php on line 2 


I also tried port 3306 but that produced a
Quote:
Could not connect: Connection refused


What am I missing here?
__________________
Evan

Reply With Quote
  #2  
Old October 10th, 2012, 07:57 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Jun 2003
Posts: 14,239 Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 15 h 20 m 7 sec
Reputation Power: 4445
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.
__________________
======
Doug G
======
It is a truism of American politics that no man who can win an election deserves to. --Trevanian, from the novel Shibumi

Reply With Quote
  #3  
Old October 10th, 2012, 08:37 PM
epanagio's Avatar
epanagio epanagio is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2003
Posts: 660 epanagio User rank is Second Lieutenant (5000 - 10000 Reputation Level)epanagio User rank is Second Lieutenant (5000 - 10000 Reputation Level)epanagio User rank is Second Lieutenant (5000 - 10000 Reputation Level)epanagio User rank is Second Lieutenant (5000 - 10000 Reputation Level)epanagio User rank is Second Lieutenant (5000 - 10000 Reputation Level)epanagio User rank is Second Lieutenant (5000 - 10000 Reputation Level)epanagio User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 5 h 32 m 17 sec
Reputation Power: 94
Stupid!
I changed it to:
PHP Code:
 $link mssql_connect('10.1.1.16:1433''ID''password'); 
and I receive a
PHP Code:
 PHP Warning:  mssql_connect(): Unable to connect to server10.1.1.16:1433 in /home/epanagio/play/remote_connect.php on line 2 
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:
Quote:
# A typical Microsoft SQL Server 2000 configuration [MyServer2k] host = 10.1.1.16 port = 1433 tds version = 8.0
[MyServer2k]
host = 10.1.1.16
port = 1433
tds version = 8.0
but it doesn't connect.

Last edited by epanagio : October 10th, 2012 at 08:45 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Connect to remote server

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap