bitherder
2006-Aug-30 18:21 UTC
mysql access -- works from webrick but not from tests or mongrel
I have set up Rails on my OS X laptop and am trying to use mysql as a backend for my Rails app. If I start the app using script/server (webrick) everything works fine, but when I try and run tests or start up mongrel I get the following error: Mysql::Error: Access denied for user ''rails''@''localhost'' (using password: YES) I''ve tried a bunch of the standard fixes for mysql access and none of them have helped. What really confuses me is webrick working but the tests and mongrel having trouble. I invoke webrick with "script/server", the tests by running "rake" and mongrel with "mongrel_rails" -- all from the rails root directory. Anybody have an idea why Rails mysql access behavior would be different under webrick than mongrel and rake run tests? Larry P.S. here''s a bunch of background info in my set-up. Version info: Mac OS: 10.4.7 ruby: 1.8.4 /opt/local/bin rails: 1.1.6 /opt/local/bin mysql: 4.1.20 /opt/local/bin mongrel_rails: 0.3.13.3 /opt/local/bin My database.yml file looks like: development: adapter: mysql database: st_development host: localhost username: rails password: ***** test: adapter: mysql database: st_test host: localhost username: rails password: ***** production: adapter: mysql database: st_production host: localhost username: rails password: ****** --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Jamie Quint
2006-Aug-30 18:49 UTC
Re: mysql access -- works from webrick but not from tests or mongrel
Did you add a "rails" user to mysql try logging in to mysql and running... GRANT ALL PRIVILEGES ON *.* TO ''rails''@''localhost'' IDENTIFIED BY ''mypassword'' WITH GRANT OPTION; ~Jamie On Aug 30, 2006, at 11:21 AM, bitherder wrote:> > I have set up Rails on my OS X laptop and am trying to use mysql as a > backend for my Rails app. > > If I start the app using script/server (webrick) everything works > fine, > but when I try and run tests or start up mongrel I get the following > error: > > Mysql::Error: Access denied for user ''rails''@''localhost'' (using > password: YES) > > I''ve tried a bunch of the standard fixes for mysql access and none of > them have helped. > > What really confuses me is webrick working but the tests and mongrel > having trouble. I invoke webrick with "script/server", the tests by > running "rake" and mongrel with "mongrel_rails" -- all from the rails > root directory. > > Anybody have an idea why Rails mysql access behavior would be > different > under webrick than mongrel and rake run tests? > > Larry > > P.S. here''s a bunch of background info in my set-up. > > Version info: > > Mac OS: 10.4.7 > ruby: 1.8.4 /opt/local/bin > rails: 1.1.6 /opt/local/bin > mysql: 4.1.20 /opt/local/bin > mongrel_rails: 0.3.13.3 /opt/local/bin > > My database.yml file looks like: > > development: > adapter: mysql > database: st_development > host: localhost > username: rails > password: ***** > > test: > adapter: mysql > database: st_test > host: localhost > username: rails > password: ***** > > production: > adapter: mysql > database: st_production > host: localhost > username: rails > password: ****** > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
bitherder
2006-Aug-30 22:08 UTC
Re: mysql access -- works from webrick but not from tests or mongrel
Hi Jamie, Good question. I should have metioned that I can log into the mysql server using the command line "mysql" application with the "rails" credentials and access and modify both the st_development and st_test databases. The st_develpment access is also confirmed by the fact that I can get my Rails app to run properly using webrick (script/server). Larry --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---