So much for the success with Ruby on Rails detailed in the last post. Everything was going fine until I tried to create a scaffold
. At which point I get a nasty little MySQL error:
Access denied for user ''@'localhost' (using password: NO)
So basically, even though I’ve defined all the database settings correctly in the database.yml
file for the application, it’s trying to connect without a username or password. And as such, quite rightly, is failing. I’ve reinstalled the mysql gem, I’ve tried configuring the database.yml
file to connect as root; none of it works. Bit frustrated – I can’t see that I’ve done anything wrong, but it’s just not working. I’ve also tried users with both old and new password hashes, and that hasn’t helped either. Anyone got any ideas? Anyone? Lazyweb?
Miki Watts | 8 Aug 2005
I think that the way it quotes the username (”@’localhost’) is a clue… when i get a similar error from MySql, it looks like this: ‘@localhost’ , so maybe it tries to use an actual username of ‘@’ ?
Tom | 8 Aug 2005
Thanks for your comment Miki, but I solved it in the end – all down to compiling the mysql gem with the wrong version of gcc.