#1
  1. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Posts
    698
    Rep Power
    95

    Mssql_connect(): Unable to connect to server:


    I've tried many different configurations of:
    PHP Code:
    $link mssql_connect('IP:1433''id''password'); 
    PHP Code:
    $link mssql_connect('DNS Name:1433''id''password'); 
    also all of the above by adding \instance_name
    also all of the above by adding the port ID :1433
    and every time I receive a
    PHP Code:
    mssql_connect(): Unable to connect to server
    message
    I am going from a freebsd to a Windows server. The freebsd server has freetds with a section
    PHP Code:
    [MyServer2k]
    host 10.1.1.16
    instance 
    KCSD
    port 
    1433
    tds version 
    8.0 
    What else can I do to debug this connection?
    Any ideas?
    Evan
  2. #2
  3. No Profile Picture
    I haz teh codez!
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2003
    Posts
    2,551
    Rep Power
    2337
    What happens when you attempt to telnet to the DB server on port 1433 from the FreeBSD box? Do you connect?
    I ♥ ManiacDan & requinix

    This is a sig, and not necessarily a comment on the OP:
    Please don't be a help vampire!
  4. #3
  5. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Posts
    698
    Rep Power
    95
    Interesting:
    PHP Code:
    telnetconnect to address 10.1.1.16Connection refused 
    telnet
    Unable to connect to remote host 
    I wonder why but I have a good lead low! THANKS!
    Evan
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Location
    Jersey
    Posts
    16
    Rep Power
    0
    Also try just a regular ping to see if the box is even online. If it is then you know either the port isn't open or the service isn't running.
  8. #5
  9. Confused badger
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Mar 2009
    Location
    West Yorkshire
    Posts
    1,112
    Rep Power
    487
    Is the SQL server configured to listen on that port?

    No response to ping could be anything though so don't go on that result, make sure that the port's open in any firewalls that stand between your box and the server.
    Last edited by badger_fruit; October 12th, 2012 at 12:54 PM. Reason: edited out typo
    "For if leisure and security were enjoyed by all alike, the great mass of human beings who are normally stupefied by poverty would become literate and would learn to think for themselves; and when once they had done this, they would sooner or later realise that the privileged minority had no function and they would sweep it away"
    - George Orwell, 1984
  10. #6
  11. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    Try connecting from another windows box using the MSSQL client.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.

IMN logo majestic logo threadwatch logo seochat tools logo