List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:April 4 2000 11:54pm
Subject:RE: Two MySQL servers
View as plain text  
>Paul,
>
>Thanks for your help.  I was refered to your book by someone on the PHP
>mailing list.  He said there was a good chapter covering this.  We ordered
>your book but we've gotten past the installation part.  I'm able to connect
>to this install via the command line by specifying the port and socket.
>When I try the same using the php command
>mysql_connect("localhost:3307:/tmp/mysql2.sock","user","pass"); , it won't
>connect.  Php is properly configured with MySQL support and I can access
>another install on MySQL easily.  Any suggestions?

Well, lessee ... I'm going to cheat and look in my book because I can't
remember all the stuff that's in there. :-)

According to page 676, you should be able to specify the first parameter
to mysql_connect as "host_name:port_num" (this will use a TCP/IP connection)
or as "localhost:/path/to/socket" (this will use a UNIX domain socket
connection).  Looks to me like you're trying to combine the two forms
and specify both a port number and path to a socket.  Try these and
see what happens:

mysql_connect("your-host-name:3307","user","pass")
     or die ("cannot connect");

mysql_connect("localhost:/tmp/mysql2.sock","user","pass")
     or die ("cannot connect");


(Also, the first form requires PHP 3.0B4 or newer and the second form
requires 3.0.10 or newer.)

-- 
Paul DuBois, paul@stripped
Thread
Two MySQL serversJason Cox4 Apr
  • Re: Two MySQL serversDan Sjolseth4 Apr
    • RE: Two MySQL serversJason5 Apr
      • RE: Two MySQL serversPaul DuBois5 Apr
        • RE: Two MySQL serversJason5 Apr
          • RE: Two MySQL serversPaul DuBois5 Apr
            • RE: Two MySQL serversJason5 Apr
              • RE: Two MySQL serversPaul DuBois5 Apr
                • synchronization over WebRobert Schott2 May