Thursday, July 30, 2009

mysql sock error

If you are getting an error like below when you start your rails server, it means that the rails environment is not able to find the mysql.sock file required to initialize a connection to the database.

/!\ FAILSAFE /!\ Thu Jul 30 13:44:11 -0400 2009
Status: 500 Internal Server Error
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
/home/sanjaymk/projects/rails/chariot/july2009/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:576:in `real_connect'

This could be either fixed by removing the socket: line in your database.yml or by finding the mysql.sock file by issuing the command mysql_config --socket in your terminal prompt. This command(mysql_config) prints out the location of your mysql.sock file.

Thanks,
Sanjay

No comments:

Post a Comment