Geoffrey Tattersfield
2005-Jan-07 19:48 UTC
ruby on cygwin and mysql - problem connecting to db
Hi, I''m trying my hand at rails by working through the tutorial. I''m stuck on getting the rails app, running on webrick, to talk to mysql. I''m getting the "No such file or directory - /tmp/mysql.sock" message that I''ve seen that others sometimes encounter. Here''s my environment: Win2k w/ cygwin installed at c:\cygwin ruby installed via cygwin setup.exe rails installed via gems mysql-nt.exe daemon running I''ve configured mysql to use put the socket at c:\cygwin\tmp\mysql.sock which is the same as /tmp/mysql.sock in the cygwin environment If I use the MySQL Command Line that get''s installed with mysql 4.1 and type the mysql command ''status'', I see that it is indeed connecting via the socket, though I see no actual file called mysql.sock in /tmp from cygwin console. (I don''t know if that''s normal but I don''t know how the unix socket thingie works on window at any rate). If I fire up cmd.exe or cygwin and start mysql from command line it connects via tcp/ip. So both of those connection methods are working. Now, on to database.yml: Here is what I have currently. development: adapter: mysql database: rails_development host: localhost username: username password: password socket: /tmp/mysql.sock With mysql.sock in its new home, I''ve tried no socket entry (default setting, correct?) and setting socket to c:/cygwin/tmp/mysql.sock, c:\cygwin\tmp\mysql.sock, and /cygdrive/c/cygwin/tmp/mysql.sock with no joy. same no such file or directory error for each socket setting. Are there any issues with ruby on cygwin and mysql? Are there any issues with my configuration? Thanks, Geoff
I run it successfully under cygwin. The change I made was to specify 127.0.0.1 instead of localhost for the host in database.yml. This makes it connect to mysql through tcp/ip instead mysql.sock. Hope that helps. -Lee -----Original Message----- From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Demetrius Nunes Sent: Friday, January 07, 2005 2:29 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails] ruby on cygwin and mysql - problem connecting to db Geoffrey, I think you should consider moving away from the cygwin version. The native Windows version that comes with the One-Click Installer is so much more reliable. Geoffrey Tattersfield wrote:> Hi, > > I''m trying my hand at rails by working through the tutorial. I''m > stuck on getting the rails app, running on webrick, to talk to mysql. > I''m getting the "No such file or directory - /tmp/mysql.sock" message > that I''ve seen that others sometimes encounter. > > Here''s my environment: > Win2k w/ cygwin installed at c:\cygwin ruby installed via cygwin > setup.exe rails installed via gems mysql-nt.exe daemon running > > I''ve configured mysql to use put the socket at > c:\cygwin\tmp\mysql.sock which is the same as /tmp/mysql.sock in the > cygwin environment > > If I use the MySQL Command Line that get''s installed with mysql 4.1 > and type the mysql command ''status'', I see that it is indeed > connecting via the socket, though I see no actual file called > mysql.sock in /tmp from cygwin console. (I don''t know if that''s > normal but I don''t know how the unix socket thingie works on window at > any rate). > > If I fire up cmd.exe or cygwin and start mysql from command line it > connects via tcp/ip. So both of those connection methods are working. > > Now, on to database.yml: > > Here is what I have currently. > > development: > adapter: mysql > database: rails_development > host: localhost > username: username > password: password > socket: /tmp/mysql.sock > > With mysql.sock in its new home, I''ve tried no socket entry (default > setting, correct?) and setting socket to c:/cygwin/tmp/mysql.sock, > c:\cygwin\tmp\mysql.sock, and /cygdrive/c/cygwin/tmp/mysql.sock with > no joy. same no such file or directory error for each socket setting. > > Are there any issues with ruby on cygwin and mysql? > > Are there any issues with my configuration? > > Thanks, > Geoff > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Demetrius Nunes wrote:> Geoffrey, I think you should consider moving away from the cygwin > version. The native Windows version that comes with the One-Click > Installer is so much more reliable.That''s the version I just got running with Rails. I installed MySQL in c:\mysql. Here''s my conf file: development: adapter: mysql database: quiz host: localhost username: JMenard password: Jim -- Jim Menard, jimm-Xhj3G7Rj6JI@public.gmane.org, http://www.io.com/~jimm
Demetrius Nunes
2005-Jan-07 21:28 UTC
Re: ruby on cygwin and mysql - problem connecting to db
Geoffrey, I think you should consider moving away from the cygwin version. The native Windows version that comes with the One-Click Installer is so much more reliable. Geoffrey Tattersfield wrote:> Hi, > > I''m trying my hand at rails by working through the tutorial. I''m > stuck on getting the rails app, running on webrick, to talk to mysql. > I''m getting the "No such file or directory - /tmp/mysql.sock" message > that I''ve seen that others sometimes encounter. > > Here''s my environment: > Win2k w/ cygwin installed at c:\cygwin > ruby installed via cygwin setup.exe > rails installed via gems > mysql-nt.exe daemon running > > I''ve configured mysql to use put the socket at > c:\cygwin\tmp\mysql.sock which is the same as /tmp/mysql.sock in the > cygwin environment > > If I use the MySQL Command Line that get''s installed with mysql 4.1 > and type the mysql command ''status'', I see that it is indeed > connecting via the socket, though I see no actual file called > mysql.sock in /tmp from cygwin console. (I don''t know if that''s > normal but I don''t know how the unix socket thingie works on window at > any rate). > > If I fire up cmd.exe or cygwin and start mysql from command line it > connects via tcp/ip. So both of those connection methods are working. > > Now, on to database.yml: > > Here is what I have currently. > > development: > adapter: mysql > database: rails_development > host: localhost > username: username > password: password > socket: /tmp/mysql.sock > > With mysql.sock in its new home, I''ve tried no socket entry (default > setting, correct?) and setting socket to c:/cygwin/tmp/mysql.sock, > c:\cygwin\tmp\mysql.sock, and /cygdrive/c/cygwin/tmp/mysql.sock with > no joy. same no such file or directory error for each socket setting. > > Are there any issues with ruby on cygwin and mysql? > > Are there any issues with my configuration? > > Thanks, > Geoff > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >