Ruby on Rails socket?

I’m trying to build my first Ruby on Rails application. I created a MySQL database and tried to point the database.yml file to the database. But when I run the script generator like this:

ruby script/generate scaffold Test Test

I get this message:

Can’t connect to local MySQL server through
/var/run/mysqld/mysqld.sock’ (2)

I think this has something to do with the database.yml configuration file but I’m not sure. Any suggestions?

Can anyone send a working sample database.yml file?