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
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