Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2006
    Posts
    41

    Unanswered: How to connect to mySQL database stored on different computer?

    Hi,

    I have 2 pc's both running Windows XP and with mySQL 5.0 installed. What I need is to be able to access a database stored on one pc from the other pc. Could someone give me a step by step guide on how to acheive this.


    Thanks

  2. #2
    Join Date
    Apr 2006
    Location
    Denver, Co. USA
    Posts
    242
    Assuming these are networked together, basically, you would enter the IP address of the computer you want to connect to. It would be best if the computer had a fixed/static IP address.

    For example, if you are using the MySQL Administrator program or Query Browser, you would enter the IP address as the "Server Host:" when you log in.

    If you are using PHP, replace xxx.xxx.xxx.xxx in the following with the IP address of the computer you want to connect to -
    PHP Code:
    $link mysql_connect('xxx.xxx.xxx.xxx''mysql_user''mysql_password')
        or die(
    'Could not connect: ' mysql_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
  •