Rake displays Can't connect local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'

i have a small problem every time i run "rake db:migrate" it shows me
an error

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

can somebody help me?


its possible that either the socket is already in use or the the path
for the socket is false..

these r the only 2 possiblities i guess


Dhaval Parikh
Software Engineer

Thanks for replying,

What you said is actually very usefull because i didn't know why this
could be happening,
can you give me any tip of how i could solve the problem?

Do you have any idea how i can start soliving this problem?

Assuming that mysql is actually installed and running,

check that what you've got in database.yml (in the socket parameter)
matches what's in /etc/my.cnf
If database.yml doesn't specify the socket then it's probably falling
back on some default, so set it to whatever is in my.cnf


Awesome, thanks
it's working now,
I specified the socket and it's working fine