[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: mysql for win

Michael Campbell

10/22/2003 1:39:00 PM

Javier Fontan wrote:

> Hello,
>
> I've had this very issue. This is because this lines in mysql.rb:
>
> --8<------
> if (host == nil or host == "localhost") and defined? UNIXSocket
then
> unix_socket = socket || ENV["MYSQL_UNIX_PORT"] ||
MYSQL_UNIX_ADDR
> sock = UNIXSocket::new(unix_socket)
> @host_info = Error::err(Error::CR_LOCALHOST_CONNECTION)
> @unix_socket = unix_socket
> ------>8--
>
> you can "fix" this by changing the "if" statement or connect to
127.0.0.1 (or the name of the machine), this will lead to use inet
sockets instead unix ones. Hope it helps.
>
> Bye


Can you show me what you changed the "if" statement to?

Thanks for this, I'll give it a shot.



__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping...

1 Answer

Javier Fontan

10/22/2003 1:53:00 PM

0


Hello,

On Wed, 22 Oct 2003 22:39:28 +0900
Michael Campbell <michael_s_campbell@yahoo.com> wrote:

> Javier Fontan wrote:
>
> > Hello,
> >
> > I've had this very issue. This is because this lines in mysql.rb:
> >
> > --8<------
> > if (host == nil or host == "localhost") and defined? UNIXSocket
> then
> > unix_socket = socket || ENV["MYSQL_UNIX_PORT"] ||
> MYSQL_UNIX_ADDR
> > sock = UNIXSocket::new(unix_socket)
> > @host_info = Error::err(Error::CR_LOCALHOST_CONNECTION)
> > @unix_socket = unix_socket
> > ------>8--
> >
> > you can "fix" this by changing the "if" statement or connect to
> 127.0.0.1 (or the name of the machine), this will lead to use inet
> sockets instead unix ones. Hope it helps.
> >
> > Bye
>
>
> Can you show me what you changed the "if" statement to?

I am not fixin it, I'm disabling a feature :). By default if UNIXSockets
are enabled (defined? UNIXSocket) and the host is localhost or nil (we
are connectin a server in the same machine) uses a unix socket that
seems to be in /tmp/mysql.sock (in my linux installation it is in
/var/lib/mysql/mysql.sock). What we can do to make it work is to correct
the path to this socket or disabling unix sockets for "localhost" then
the line could be changed to this:

if (host == nil) and defined? UNIXSocket

Only when host is not defined uses unix sockets, or this

if false

This way disables any try to use unix sockets

Bye


>
> Thanks for this, I'll give it a shot.
>
>
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
> http://shopping...
>
>