Hi, I''m trying to set up Ruby on Rails following Apple''s tutorial with ruby 1.8.4 and mysql 5.0.22. But every time I ran ''rake migrate'' I got the following access denied error: Access denied for user ''root''@''localhost'' (using password: YES) After turning on --trace switch, it showed the error happened at the following line: /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/mysql_adapter.rb:331:in `real_connect'' I don''t whether it''s a rails problem or mysql problem. But I thought I would give it a shot by posting the question here. Thanks in advance. Regards, Simon -- Posted via http://www.ruby-forum.com/.
It''s a MySQL problem. You''ve got to ''grant access'' for the user in mysql or do one of the options here; http://dev.mysql.com/doc/refman/5.0/en/access-denied.html Best, russ>Hi, > >I''m trying to set up Ruby on Rails following Apple''s tutorial with ruby >1.8.4 and mysql 5.0.22. But every time I ran ''rake migrate'' I got the >following access denied error: > >Access denied for user ''root''@''localhost'' (using password: YES) > >After turning on --trace switch, it showed the error happened at the >following line: > >/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/mysql_adapter.rb:331:in >`real_connect'' > >I don''t whether it''s a rails problem or mysql problem. But I thought I >would give it a shot by posting the question here. > >Thanks in advance. > >Regards, > >Simon > >-- >Posted via http://www.ruby-forum.com/. >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/rails
Thanks Russ. It doesn''t look like an access problem though because I can access with the same user and password using mysql command line tool. Also, ''rake migrate'' worked after I set the password to be empty. Could it be the way rails sends password to mysql? -- Posted via http://www.ruby-forum.com/.
Simon Lin wrote:> Thanks Russ. > > It doesn''t look like an access problem though because I can access with > the same user and password using mysql command line tool. Also, ''rake > migrate'' worked after I set the password to be empty. Could it be the > way rails sends password to mysql? >
Simon Lin wrote:> It doesn''t look like an access problem though because I can access with > the same user and password using mysql command line tool. Also, ''rake > migrate'' worked after I set the password to be empty. Could it be the > way rails sends password to mysql?This sounds like an incomparability between mysql 4.0 and earlier and 4.1 and later. There was a change to the password hashing algorithm. Version 4.0 and earlier use 16 characters, 4.1 and later 40 characters. The standard ruby installation uses a mysql adapter that is compatible with 4.0 and below. You need to update your mysql adapter. http://www.tmtm.org/en/mysql/ruby/ If you aren''t comfortable at the command line, there are some other instructions which Google will point you to. -- Ray
Ray Baxter wrote:> Simon Lin wrote: > >> It doesn''t look like an access problem though because I can access with >> the same user and password using mysql command line tool. Also, ''rake >> migrate'' worked after I set the password to be empty. Could it be the >> way rails sends password to mysql? > > This sounds like an incomparability between mysql 4.0 and earlier and > 4.1 and later. There was a change to the password hashing algorithm. > Version 4.0 and earlier use 16 characters, 4.1 and later 40 characters. > > The standard ruby installation uses a mysql adapter that is compatible > with 4.0 and below. You need to update your mysql adapter. > > http://www.tmtm.org/en/mysql/ruby/ > > If you aren''t comfortable at the command line, there are some other > instructions which Google will point you to. > > -- > > RayThanks. It still doesn''t work. It must be a ruby adapter''s problem because I can connect through JDBC with no problem. I''m gonna give up on this one. The MacBook is after all just my development box. It seems to be working fine on the server, a Ubuntu desktop. I guess I can live with using a user without password on the MacBook. -- Posted via http://www.ruby-forum.com/.
Is the Ubuntu box running mysql5 also? On 6/3/06, Simon Lin <noisebar@gmail.com> wrote:> Ray Baxter wrote: > > Simon Lin wrote: > > > >> It doesn''t look like an access problem though because I can access with > >> the same user and password using mysql command line tool. Also, ''rake > >> migrate'' worked after I set the password to be empty. Could it be the > >> way rails sends password to mysql? > > > > This sounds like an incomparability between mysql 4.0 and earlier and > > 4.1 and later. There was a change to the password hashing algorithm. > > Version 4.0 and earlier use 16 characters, 4.1 and later 40 characters. > > > > The standard ruby installation uses a mysql adapter that is compatible > > with 4.0 and below. You need to update your mysql adapter. > > > > http://www.tmtm.org/en/mysql/ruby/ > > > > If you aren''t comfortable at the command line, there are some other > > instructions which Google will point you to. > > > > -- > > > > Ray > > Thanks. It still doesn''t work. It must be a ruby adapter''s problem > because I can connect through JDBC with no problem. I''m gonna give up > on this one. The MacBook is after all just my development box. It > seems to be working fine on the server, a Ubuntu desktop. I guess I can > live with using a user without password on the MacBook. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- -------------- Jon Gretar Borgthorsson http://www.jongretar.net/
Have you tried using Locomotive? I used that to set up my new macbook and it was a breeze. Steve On 6/3/06, Simon Lin <noisebar@gmail.com> wrote:> > Ray Baxter wrote: > > Simon Lin wrote: > > > >> It doesn''t look like an access problem though because I can access with > >> the same user and password using mysql command line tool. Also, ''rake > >> migrate'' worked after I set the password to be empty. Could it be the > >> way rails sends password to mysql? > > > > This sounds like an incomparability between mysql 4.0 and earlier and > > 4.1 and later. There was a change to the password hashing algorithm. > > Version 4.0 and earlier use 16 characters, 4.1 and later 40 characters. > > > > The standard ruby installation uses a mysql adapter that is compatible > > with 4.0 and below. You need to update your mysql adapter. > > > > http://www.tmtm.org/en/mysql/ruby/ > > > > If you aren''t comfortable at the command line, there are some other > > instructions which Google will point you to. > > > > -- > > > > Ray > > Thanks. It still doesn''t work. It must be a ruby adapter''s problem > because I can connect through JDBC with no problem. I''m gonna give up > on this one. The MacBook is after all just my development box. It > seems to be working fine on the server, a Ubuntu desktop. I guess I can > live with using a user without password on the MacBook. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060604/67d3f732/attachment.html
On 4-jun-2006, at 2:46, Steve Odom wrote:> Have you tried using Locomotive? I used that to set up my new > macbook and it was a breeze.It''s obviosly the "old passwords" problem in MySQL. Please google. -- Julian ''Julik'' Tarkhanov please send all personal mail to me at julik.nl
Thanks for all the suggestions guys. Like I said, I might just stick to the user without password solution. :-) I''m sure someday there will be a version of the adapter that will ''just work''. Julian ''Julik'' Tarkhanov wrote:> On 4-jun-2006, at 2:46, Steve Odom wrote: > >> Have you tried using Locomotive? I used that to set up my new >> macbook and it was a breeze. > > It''s obviosly the "old passwords" problem in MySQL. Please google. > > > -- > Julian ''Julik'' Tarkhanov > please send all personal mail to > me at julik.nl-- Posted via http://www.ruby-forum.com/.
Try this: sudo gem install mysql -- --with-mysql-config Cheers, -DF On 6/4/06, Simon Lin <noisebar@gmail.com> wrote:> Thanks for all the suggestions guys. Like I said, I might just stick to > the user without password solution. :-) I''m sure someday there will be > a version of the adapter that will ''just work''. > > Julian ''Julik'' Tarkhanov wrote: > > On 4-jun-2006, at 2:46, Steve Odom wrote: > > > >> Have you tried using Locomotive? I used that to set up my new > >> macbook and it was a breeze. > > > > It''s obviosly the "old passwords" problem in MySQL. Please google. > > > > > > -- > > Julian ''Julik'' Tarkhanov > > please send all personal mail to > > me at julik.nl > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >