Accessing Remote MySQL Databases

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Benedictum

    Accessing Remote MySQL Databases

    How do I access data from a database located in a server somewhere with an
    application running on a local machine?


  • Gordon Burditt

    #2
    Re: Accessing Remote MySQL Databases

    >How do I access data from a database located in a server somewhere with an[color=blue]
    >application running on a local machine?[/color]

    mysql_connect() or mysql_pconnect( ) takes arguments including
    hostname (of the server), username, and password. Specify something
    other than "localhost" for the server.

    Note that there's no particular reason you can't have several
    connections open to different databases on different servers at the
    same time if you want (although there's probably a limit somewhere;
    if nothing else, you run out of file descriptors). You do need to
    specify the resource for the appropriate connection when you use
    it. And there is no way to do a cross-server join that I know of.

    Gordon L. Burditt

    Comment

    • Jay Donnell

      #3
      Re: Accessing Remote MySQL Databases

      Make sure you set the permissions on the remote MySQL server to allow
      you to connect remotely.

      Jay

      Comment

      Working...