Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby ActiveRecord Basics Migrations and Relationships Migrations

Jake White
Jake White
41,730 Points

mysql issue

When trying to run the rake db:create, I get the following error

<Mysql2::Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)>

Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "pool"=>5, "username"=>"root", "password"=>nil, "host"=>"localhost", "database"=>"biller_test"}, {:charset=>"utf8", :collation=>"utf8_unicode_ci"} (If you set the charset manually, make sure you have a matching collation)

Any help would be appreciated.

1 Answer

ignacio palma
ignacio palma
8,698 Points

I am a newbie here but i think the problem is that you didn't set the password in the database.yml file, so it can't go into the root user. If you haven't created you might wanna see the mysql course and create a user&password.

Jake White
Jake White
41,730 Points

Thanks Ignacio. I actually figured this out a few days ago, and that was the problem.