From: Dave Cheney Date: 2008-06-23T18:49:01+09:00 Subject: Re: Rails - Access denied for user 'root'@'localhost' ... If I can suggest that using the root account on mysql is not considered best practice. I would setup an account for your application thusly mysql> grant all on yourapp_production.* to 'yourapp'@'' identified by 'decent_password'; mysql> flush privileges; http://dev.mysql.com/doc/refman/5.0/en/grant.html Cheers Dave On 23/06/2008, at 5:48 PM, Jim Cochrane wrote: > I found a fix for the problem, so I'll answer my own question in > case it > will help someone else with the same problem. > > I did the following things to fix it: > > - run mysql_setpermission and use its interactive interface to > allow the > mysql root user to do everything (need to know the mysql root pw). > > - use the mysql command to connect as root and create the needed > database > (in this case, ajaxonrails_development). > > - In database.yml, make sure username is root and fill in the > password > field for the mysql root pw (or change the username to another mysql > user and the password to that user's password). > > (Running mysql 14.12 on ubuntu 8.04 with rails 2.0.2-1; mysql, > installed > via apt-get, was apparently initialized with only ordinary user > privileges for root.)