Hey, I''m new to Rails and Ruby. I''m using the book "Agile Web Development with Rails, 1st Edition". As per the instructions, I created a file called create.sql in db folder of my app, following is the sql: drop table if exists products; create table products ( id int not null auto_increment, title varchar(100) not null, description text not null, image_url varchar(200) not null, price decimal(10,2) not null, primary key (id) ); And when i run the command mysql depot_development <db/create.sql i get an error msg ERROR 1045 (28000) : Access denied for user ''ODBC''@''localhost'' (using> passowrd: NO)and when i try to use the same sql in the mysql prompt directly, it works!! can anyone tell me why this is so? -- Prithvi Krishna Mandava (91)9880067859 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> > ERROR 1045 (28000) : Access denied for user ''ODBC''@''localhost'' (using > passowrd: NO) > > and when i try to use the same sql in the mysql prompt directly, it works!! > can anyone tell me why this is so? >It sounds like you are logged into mysql as a different user i.e. not ''ODBC''. What happens when you run the command as root: sudo mysql depot_development <db/create.sql --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Prithvi Krishna Mandava wrote:> ERROR 1045 (28000) : Access denied for user ''ODBC''@''localhost'' (using > passowrd: NO)Double check your database.yml. Make sure the username and password are the same ones you''re using on the command line (or the same as your login account if you''re not using any on the command line). Justin Blake --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
In MySQL, enter: grant all on database_name.* to ''ODBC''@''localhost''; Haven''t figured out exactly what makes this necessary, but it fixes the problem. hth, Bill ----- Original Message ----- From: "blaix" <jblaix-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> To: "Ruby on Rails: Talk" <rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Sent: Saturday, December 23, 2006 10:50 AM Subject: [Rails] Re: Problem with setting up database.> > Prithvi Krishna Mandava wrote: >> ERROR 1045 (28000) : Access denied for user ''ODBC''@''localhost'' (using >> passowrd: NO) > > Double check your database.yml. Make sure the username and password are > the same ones you''re using on the command line (or the same as your > login account if you''re not using any on the command line). > > Justin Blake > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> grant all on database_name.* to ''ODBC''@''localhost''; > > Haven''t figured out exactly what makes this necessary, but it fixes the > problem.It gives admin permission to the database for the user: ''ODBC''@''localhost''. Without granting permission, the user doesn''t have access to the database. Fine for development, but not a good idea in production to grant permissions so freely. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---