Forum: Ruby on Rails Ruby on Rails on MacBook

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Simon L. (Guest)
on 2006-06-03 08:15
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
Russ (Guest)
on 2006-06-03 08:32
(Received via mailing list)
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
Simon L. (Guest)
on 2006-06-03 09:45
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?
Ray B. (Guest)
on 2006-06-03 10:21
(Received via mailing list)
Simon L. wrote:
Ray B. (Guest)
on 2006-06-03 11:22
(Received via mailing list)
Simon L. 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
Simon L. (Guest)
on 2006-06-04 01:10
Ray B. wrote:
> Simon L. 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.
Jón B. (Guest)
on 2006-06-04 03:17
(Received via mailing list)
Is the Ubuntu box running mysql5 also?

On 6/3/06, Simon L. <removed_email_address@domain.invalid> wrote:
> > Version 4.0 and earlier use 16 characters, 4.1 and later 40 characters.
> >
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
Steve O. (Guest)
on 2006-06-04 04:48
(Received via mailing list)
Have you tried using Locomotive? I used that to set up my new macbook
and it
was a breeze.

Steve
Julian 'Julik' Tarkhanov (Guest)
on 2006-06-04 07:21
(Received via mailing list)
On 4-jun-2006, at 2:46, Steve O. 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
Simon L. (Guest)
on 2006-06-04 10:19
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 O. 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
David F. (Guest)
on 2006-06-04 11:15
(Received via mailing list)
Try this:

sudo gem install mysql -- --with-mysql-config

Cheers,

-DF
This topic is locked and can not be replied to.