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

Jake White
Jake White
41,721 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,721 Points

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