Connect two different database server using PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #16
    hm, as expected…

    could you PM (private messaging) me both host names, so that I can try if I get the same errors?

    Comment

    • tokcy
      New Member
      • Sep 2008
      • 45

      #17
      send me ur email id or how can i send PM via bytes

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #18
        go to "User Control Panel" (click on your username just below the Bytes logo). in the left side menu there is the "Private Messages" group, click on "Send New Message". use "Dormilich" (w/o the quotes) as recipient. type message. click on the "Submit Message" button when you’re done. ;)

        alternatively, click on my username, this brings you to my public profile. go to the "Contact Info" tab, click on "Send a Private Message …". proceed as above.

        Comment

        • tokcy
          New Member
          • Sep 2008
          • 45

          #19
          i have sent you the message with all the details...

          thanks

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #20
            1) can't connect to second server (hostname (chessimmigrati on.com) unknown) but it should work for you since it's your localhost

            2) can find first server, but can't establish connection
            Code:
            $c1 = mysql_connect('chessglobalproperties.com', $user, $pass);
            
            Warning: mysql_connect(): Lost connection to MySQL server at 'reading initial communication packet', system error: 61
            after some research I found out that "system error: 61" means that you can only connect this particular DB with "localhost" as host name (i.e. not from outside). you need to alter the mysql conf file to get this working.

            note: to pass the socket you need to use MySQLi

            Comment

            • tokcy
              New Member
              • Sep 2008
              • 45

              #21
              thank you very much for your co-operation...

              i will do the same according to your reply...

              Comment

              • VisHEarT
                New Member
                • Mar 2010
                • 2

                #22
                hi ... i have same problem.. i have two databases from two different server and i want to connect in one php page but its giving me error like...
                Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'www.domain2.co m'..
                Please help...
                Thanks in advance..

                Comment

                • Dormilich
                  Recognized Expert Expert
                  • Aug 2008
                  • 8694

                  #23
                  the second server must allow remote connection …

                  Comment

                  • sadiq111
                    New Member
                    • May 2013
                    • 1

                    #24
                    i have the problem in connecting two different database server, actually i want to take out data from MySQl table and want to istore it into MsSQl databse on the same page, i tried using mysql_connect() and mssql_conect() to connect with databases
                    bum i m getting 500 error that is internal server error plz help me ..!! thnaks in advanced

                    Comment

                    • Dormilich
                      Recognized Expert Expert
                      • Aug 2008
                      • 8694

                      #25
                      first make sure that both servers are properly installed (should be the least problem), then make sure PHP has both the mysql and mssql extensions installed. if that is also given, ask your host’s support.

                      Comment

                      Working...