Find the answer to your Linux question:
Results 1 to 6 of 6
Hey, Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'SQL server' in /var/www/cam.php on line 2 Unable to connect Is the problem in my code or connection in my office? Any ...
  1. #1
    Just Joined!
    Join Date
    Aug 2009
    Posts
    80

    Error: How to fix it?

    Hey,


    Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'SQL server' in /var/www/cam.php on line 2
    Unable to connect

    Is the problem in my code or connection in my office?


    Any Help!

  2. #2
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    that is an invalid host name, a hostname can't have a space in it

  3. #3
    Just Joined!
    Join Date
    Aug 2009
    Posts
    80
    Hey,

    Actually I'm running the PHP code on my laptop, but the SQL server is in my office.

    I guess can't use "localhost" as my host, but the SQL server name.

    So I used the SQL server name ( Client ) instead of localhost, but I still get the error.

    Now what's the problem?

  4. #4
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    you need to connect to the machine running the sql server, whatever that may be, it is impossible for that machine to be named "SQL server"

  5. #5
    Just Joined!
    Join Date
    Aug 2009
    Posts
    80
    Is it possible using IP address?

    Suppose, if I have the DB on my laptop itself, will the "localhost" help.

  6. #6
    Just Joined!
    Join Date
    Aug 2009
    Posts
    80
    The problem is it's a MS SQL db, but I had used My SQL quires, but once I fixed/replaced MySQL with MS SQL.

    I get below error:
    Fatal error: Call to undefined function mssql_connect() in /var/www/cam.php on line 2

    If it's to work with php.ini file, coz I knew location of php.ini file on windows. Since I'm newbie to Linux, I didn't know that.

    How can I get rid of this error?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...