Results 1 to 6 of 6
  1. #1

    Connecting to a remote db

    Hello guys,

    This questions is about databases. Lets say i have a database at and i want the php script at to access the same databases as

    So in my php configuration file (where the db login details go), i assume

    $dbhost='localhost'; would be changed to $dbhost='SOMETHING ELSE'; ???

    I need to know what comes instead of localhost and where can i find that from my server. I was able to find something called

    MYSQL_SOCKET /var/run/mysqld/mysqld.sock

    is that it?


  2. #2
    Join Date
    Jul 2003
    Either the ip address or hostname for example or also the mysql server will need to have the ip for the server getting the querys so that it has permission to do so.

  3. #3
    Yup, I always use a hostname(domain name) so if I ever move the DB server, I don't have to remember to change the IP address too.

  4. #4
    want to know php/mysql database ip address

    Anybody tell me how to find the php/mysql database ip of domain.. I have site www . spellfinder . com and my programmer asking it's database ip to connect the software to website database..... I have search on cpanel , but couldnt find anything ... Plz help me to find it... thanks

  5. #5
    Normally we are connecting to mysql databases like $dbhost='localhost'

    For a remote conection you can use th remote machines ipaddress
    say ($dbhost='')
    and give the remote machines mysql username and password.

    also if you have the remote machine host name try withthat also instead of the ip address.
    Choose the right option ... The world is open for You..

  6. #6
    Join Date
    Feb 2005
    Galway, Ireland
    It is very easy if you have all your domains on 1 server. Just do what others adviced. But if you run your domains from multiple servers, you will need to make sure that firewall and mysql config will allow connections from other servers. It's usually enabled only for 'localhost' connections by default.

Posting Permissions

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