Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby ActiveRecord Basics Migrations and Relationships Migrations

rake db:create & mysql

I recently switched my OS to Ubuntu and re-installed all RoR along with mySQL. After creating my new rails app and type in the good old fashion rake db:create, I receive the following response..

Access denied for user 'root'@'localhost' (using password: NO)Please provide the root password for your mysql installation

I type in my password and receive the same response. I am able to enter into mysql using the same root password with no issues. Can anyone help me identify this problem?

3 Answers

Maciej Czuchnowski
Maciej Czuchnowski
36,440 Points

I had the same problem, had to force a change of mysql password for root (although I never set one) and after that write this password in my config/database.yml file.

Try this method: http://askubuntu.com/questions/489098/unable-to-reset-root-password-of-mysql

Nikola Novakovic
Nikola Novakovic
4,171 Points

Wow this was so useful! As TJ below said, there was an issue with this on the TreehouseVM and it can be fixed with this! :)))

The same issue for my treehouse virtual machine (VirtualBox + vagrant) that was installed in the previous lessons of RubyOnRails. The fixes Maciej suggested work fine for me: i.e.

[1]  sudo dpkg-reconfigure mysql-server-5.5    # (re)set root password
[2]  add the pasword in "password: ***" lines of .../config/database.yml
Carlos Reyes
Carlos Reyes
30,056 Points

weeeeeeeeeeee

This worked for me too, solved my problem in the course ActiveRecord Basic > Migrations.

Working in win 8 + TVM.

Regards,