eryan.yu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jun-24 17:27 UTC
MySQL problem: #28000Access denied for user
Hi All, sorry if i asked a very stupid question. i am new for ROR and i dont have too much admin skill for MySQL. i have trouble on setting up the database connection, for my ROR. when i just run a simple scaffold controller, i''ve got this error message: Mysql::Error in BlogController#index #28000Access denied for user ''erv2''@''localhost'' (using password: YES) RAILS_ROOT: ./script/../config/.. here is the setting of my database.yml file: adapter: mysql database: mapapp username: erv2 password: 000000 host: localhost here is the screen shot of the MySQL Adminstrator, showing that i gave access to "erv2@localhost": http://lh3.google.com/image/eryan.yu/Rn6ouEu86II/AAAAAAAAAHA/iG59n7UhbGo/Capture_7.jpg I spent two days working on this problem, searching everywhere for solutions, but none of them solves my problem. i dont think it''s a very hard problem, i may just have missed some tiny little thing. can someone give me some hints? i really want to get going on making my first webapp. thank you very much. --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Most likely the problem is with your password. You expect it to be a string ''0000000'' when rials connects to a DB, but in reality, since database.yml is processed by YAML, it is a in integer 0. You need to quote strings that can be interpreted as something else in YAML files. In your case, the config should be: adapter: mysql database: mapapp username: erv2 password: "000000" host: localhost To show you how it works:>> YAML.load ''password: 000000''=> {"password"=>0}>> YAML.load ''password: "000000"''=> {"password"=>"000000"} Don''t forget to bounce the application after changing the config ;-) Val http://revolutiononrails.blogspot.com/ On Jun 24, 1:27 pm, "eryan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <eryan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi All, > > sorry if i asked a very stupid question. > > i am new for ROR and i dont have too much admin skill for MySQL. i > have trouble on setting up the database connection, for my ROR. when > i just run a simple scaffold controller, i''ve got this error message: > > Mysql::Error in BlogController#index > #28000Access denied for user ''erv2''@''localhost'' (using password: YES) > RAILS_ROOT: ./script/../config/.. > > here is the setting of my database.yml file: > adapter: mysql > database: mapapp > username: erv2 > password: 000000 > host: localhost > > here is the screen shot of the MySQL Adminstrator, showing that i gave > access to "erv2@localhost":http://lh3.google.com/image/eryan.yu/Rn6ouEu86II/AAAAAAAAAHA/iG59n7Uh... > > I spent two days working on this problem, searching everywhere for > solutions, but none of them solves my problem. > > i dont think it''s a very hard problem, i may just have missed some > tiny little thing. can someone give me some hints? i really want to > get going on making my first webapp. > > thank you very much.--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
eryan.yu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jun-24 23:46 UTC
Re: MySQL problem: #28000Access denied for user
spot on! this is THE place! thank you so much!!! On Jun 24, 9:00 pm, Val <v.alekse...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Most likely the problem is with your password. You expect it to be a > string ''0000000'' when rials connects to a DB, but in reality, since > database.yml is processed by YAML, it is a in integer 0. You need to > quote strings that can be interpreted as something else in YAML files. > In your case, the config should be: > adapter: mysql > database: mapapp > username: erv2 > password: "000000" > host: localhost > > To show you how it works: > > >> YAML.load ''password: 000000'' > => {"password"=>0} > >> YAML.load ''password: "000000"'' > > => {"password"=>"000000"} > > Don''t forget to bounce the application after changing the config ;-) > > Valhttp://revolutiononrails.blogspot.com/ > > On Jun 24, 1:27 pm, "eryan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <eryan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi All, > > > sorry if i asked a very stupid question. > > > i am new for ROR and i dont have too much admin skill for MySQL. i > > have trouble on setting up the database connection, for my ROR. when > > i just run a simple scaffold controller, i''ve got this error message: > > > Mysql::Error in BlogController#index > > #28000Access denied for user ''erv2''@''localhost'' (using password: YES) > > RAILS_ROOT: ./script/../config/.. > > > here is the setting of my database.yml file: > > adapter: mysql > > database: mapapp > > username: erv2 > > password: 000000 > > host: localhost > > > here is the screen shot of the MySQL Adminstrator, showing that i gave > > access to "erv2@localhost":http://lh3.google.com/image/eryan.yu/Rn6ouEu86II/AAAAAAAAAHA/iG59n7Uh... > > > I spent two days working on this problem, searching everywhere for > > solutions, but none of them solves my problem. > > > i dont think it''s a very hard problem, i may just have missed some > > tiny little thing. can someone give me some hints? i really want to > > get going on making my first webapp. > > > thank you very much.--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---