Unable To Remotely Connect To MySQL Server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kristy
    Junior Member
    • Apr 2005
    • 1

    #1

    Unable To Remotely Connect To MySQL Server

    Hi.. I hope someone can help out because I'm out of ideas

    I've added my computer's IP address to the list of Access Hosts under my MySQL section (in the CPanel) but for some reason, my PHP script can't connect to the MySQL server nor can I connect directly to the server via a MySQL client (I'm running a linux desktop with MySQL installed).

    I've already confirmed MySQL's IP address with Dathorn's Tech Support but I still get the error:

    Warning: mysql_pconnect(): Can't connect to MySQL server on '69.56.130.147'

    Has anyone managed to do this?

    Thanks,
    Kristy
  • AndrewT
    Administrator
    • Mar 2004
    • 3655

    #2
    As I just noted in your ticket, remote MySQL connections are not allowed. Furthermore, persistent connections are strictly prohibited.

    Comment

    • Pedja
      Senior Member
      • Mar 2004
      • 329

      #3
      Check the FAQ section: http://forums.dathorn.com/showthread.php?t=216

      Comment

      • paradiselost
        Member
        • Apr 2004
        • 31

        #4
        Not Possible

        I ran into this problem also when I started with Dathorn. Yes you can tunnel in with ssh, but there is no way to remotely connect with a script (like php) into mysql at Dathorn. If your goal is to test your scripts locally but use dathorn's database (that's what I wanted to do) then you are out of luck. A better way to do testing is to install mysql on your local machine and dump back and forth between servers. I even set up myphpadmin locally and it works really well now.

        Hope this helps you.
        --
        ** DEVTRENCH **
        --
        James Ehly

        Comment

        • Pedja
          Senior Member
          • Mar 2004
          • 329

          #5
          When you establish SSH conection I see no reason why php would not be able to use it.

          Comment

          • paradiselost
            Member
            • Apr 2004
            • 31

            #6
            Tutorial?

            Has anyone ever done it though? When I asked this same question on the forum a while ago, seemed like no one had.

            I'm having trouble connecting to MySQL from a remote host using PHP. I have no problems connecting to the database from 'localhost', but when I change the host to mydomain.com and try to access it from a remote computer I get this error: Warning: Can't connect to MySQL server on 'mydomain.com' (110) in /usr/local/apache/htdoc


            Could someone who's done this sucessfully teach the rest of us how it's done? I'm not sure exactly how to do ssh with php. (Note that I'm running php locally along with mysql - so how do I tell my local version of php to use the mysql over ssh?)
            --
            ** DEVTRENCH **
            --
            James Ehly

            Comment

            • james
              Senior Member
              • Mar 2004
              • 183

              #7
              I've got it working before.

              You set up the ssh tunnel, as per http://forums.dathorn.com/showthread.php?t=216.

              Then, on your pc where your web server is installed and the ssh tunnel is running, use localhost as the db server. This will go through the tunnel to the dathorn server, reading data from there.

              ie
              in php use:
              server: localhost
              username: your dathorn db username
              pass: your dathorn db pass
              database: your dathorn db name

              James

              Comment

              Working...