Forum: Ruby on Rails mysql connection problems

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.
2e3d01ef4f4cb07809aaacf837b0d006?d=identicon&s=25 Alex Amat (alexamat)
on 2005-12-14 17:10
Hi

hi i have a problem trying to connect to the mysql database when I do a
rake it says: Access denied for user: '@localhost' to database ''

My database.yml file is fine

Any ideas why this is happening
0baf15984ec3df75305ee58ac93c7106?d=identicon&s=25 Thomas Janke (Guest)
on 2005-12-14 17:36
(Received via mailing list)
On Wed, Dec 14, 2005 at 05:10:34PM +0100, Alex Amat wrote:
> hi i have a problem trying to connect to the mysql database when I do a
> rake it says: Access denied for user: '@localhost' to database ''
>
> My database.yml file is fine
>
> Any ideas why this is happening
>
Can u connect to the database via

mysql -u [usename] -p [database]

?

It seems to be that your username und databasename is empty.

Greetings Thomas
2e3d01ef4f4cb07809aaacf837b0d006?d=identicon&s=25 Alex Amat (alexamat)
on 2005-12-14 18:16
yes I can connect without a problem

Thomas Janke wrote:
> On Wed, Dec 14, 2005 at 05:10:34PM +0100, Alex Amat wrote:
>> hi i have a problem trying to connect to the mysql database when I do a
>> rake it says: Access denied for user: '@localhost' to database ''
>>
>> My database.yml file is fine
>>
>> Any ideas why this is happening
>>
> Can u connect to the database via
>
> mysql -u [usename] -p [database]
>
> ?
>
> It seems to be that your username und databasename is empty.
>
> Greetings Thomas
38a8230ed3d5c685558b4f0aad3fc74b?d=identicon&s=25 Joe Van Dyk (Guest)
on 2005-12-14 18:21
(Received via mailing list)
On 12/14/05, Alex Amat <amatbcn@hotmail.com> wrote:
> Hi
>
> hi i have a problem trying to connect to the mysql database when I do a
> rake it says: Access denied for user: '@localhost' to database ''
>
> My database.yml file is fine

Can you post your database.yml config (feel free to change your
password to xxxxx).
4cacb94a089bfbf0541db7b9c8081f74?d=identicon&s=25 Kevin Bedell (Guest)
on 2005-12-14 18:24
(Received via mailing list)
This seems to be related to the known issue surrounding mysql
connections that
came out in the last RC but was fixed in the very latest ActiveRecord.

Search the list archives for your error message - threads yesterday went
through
the fix (which was essentially to update to the new 1.0 release and
force
dependencies to be updated as well).



Quoting Thomas Janke <janke@imco.de>:

> mysql -u [usename] -p [database]
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>




Kevin Bedell
http://www.kbedell.com

"Imagination is more important than knowledge."
 - Albert Einstein
Ce60c4f78a63b0695e4dafc4bd7964f7?d=identicon&s=25 Lou Vanek (Guest)
on 2005-12-14 19:10
(Received via mailing list)
. if possible update to the rails latest gems
. if you have the option, update mysql to at least 4.1
. what version of mysql are you using?
. have you looked at previous threads?
	Subject: "Problem with mysql"
	Posted yesterday.
	And there are more threads that talk about this.
. you may want to change the passwords to either the old- or new-style
    as a last resort if nothing else works for you. This has been
    discussed in a previous thread. I think here,
    http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/...
    http://comments.gmane.org/gmane.comp.lang.ruby.rails/33919
C32bf81ac76a7cf1d59d05d95f835f3e?d=identicon&s=25 Guest (Guest)
on 2005-12-14 20:06
> rake it says: Access denied for user: '@localhost' to database ''


tow things that worked for me in the past:

1)instead of granting @localhost, try to grant @127.0.0.1  (bizarre, but
worked for me, i just can't remind the link where i read)

2)if using mysql 5, do check for old/new password style

good luck
Andre
This topic is locked and can not be replied to.