Is there a downside to commenting out the ''socket'' option of the MySQL adapter in database.yml by default? It''s not uncommon to run the ''rails'' command before the database has been install properly or started, and wind up with a bogus socket option set in database.yml. For example, if the MySQL server isn''t running, you end up with: socket: /path/to/your/mysql.sock Then when you go to run the app you get: Can''t connect to local MySQL server through socket ''/path/to/your/ mysql.sock'' (2) That''s a fairly easy one to diagnose. Less intuitive is if you botch a MySQL install and end up with two active sockets where the database.yml points at one socket by default, but you intended the app to use the other socket. Currently, the database.yml is generated as follows: socket: /tmp/mysql.sock # Connect on a TCP socket. If omitted, the adapter will connect on the # domain socket given by socket instead. #host: localhost #port: 3306 I''m proposing that it should be generated as: # Connect on a TCP socket. If omitted, the adapter will connect on the # domain socket given by socket instead. #socket: /path/to/mysql.sock #host: localhost #port: 3306 That is, setting a socket is the exception rather than the rule. For most of the get-up-and-running apps I''ve seen, the socket isn''t necessary. Trying to set it is often an impediment to getting started with Rails. But I suspect there may be downsides that led to the decision to use a default socket. Mike
On Sat, Mar 04, 2006 at 09:48:50AM -0700, Mike Clark wrote:> That is, setting a socket is the exception rather than the rule. For > most of the get-up-and-running apps I''ve seen, the socket isn''t > necessary.FWIW, this has been my experience as well. -- Keegan Quinn <keegan@thebasement.org> CEO, Producer the basement productions http://www.thebasement.org _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
+1 to comment out socket On 3/4/06, Keegan Quinn <keegan@thebasement.org> wrote:> On Sat, Mar 04, 2006 at 09:48:50AM -0700, Mike Clark wrote: > > That is, setting a socket is the exception rather than the rule. For > > most of the get-up-and-running apps I''ve seen, the socket isn''t > > necessary. > > FWIW, this has been my experience as well. > > -- > Keegan Quinn <keegan@thebasement.org> > CEO, Producer > the basement productions > http://www.thebasement.org > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.1 (GNU/Linux) > > iD8DBQFECf/JRMUr35HwZXoRArjkAKCS14lW/e4n5+UsmRSe6sq/k+KqIgCeMc++ > Pq1/nfppUM0291cJqkWj15k> =dFw0 > -----END PGP SIGNATURE----- > > > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core > > >
> That is, setting a socket is the exception rather than the rule. For > most of the get-up-and-running apps I''ve seen, the socket isn''t > necessary. Trying to set it is often an impediment to getting > started with Rails. But I suspect there may be downsides that led to > the decision to use a default socket.I committed the current implementation of the ''socket finder''. I guess if all major mysql packagers (linux distros etc.) configure mysql to listen for TCP/IP then there''s no harm. Perhaps an alternative is to have the commented version if mysql.sock wasn''t found in any of the common locations? -- Cheers Koz
Michael Koziarski wrote:>> That is, setting a socket is the exception rather than the rule. For >> most of the get-up-and-running apps I''ve seen, the socket isn''t >> necessary. Trying to set it is often an impediment to getting >> started with Rails. But I suspect there may be downsides that led to >> the decision to use a default socket. >> > > I committed the current implementation of the ''socket finder''. I > guess if all major mysql packagers (linux distros etc.) configure > mysql to listen for TCP/IP then there''s no harm. > > Perhaps an alternative is to have the commented version if mysql.sock > wasn''t found in any of the common locations? >I vote for this option. -- stefan -- For rails performance tuning, see: http://railsexpress.de/blog Subscription: http://railsexpress.de/blog/xml/rss20/feed.xml