In my application I have a runner script running on schedule (crontab) that needs to connect to database and get some information. I get the following error when I try to run a query ( using Model.find(...) ) :
.../vendor/rails/railties/lib/commands/runner.rb:45: .../vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:471:in `real_connect': Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) (Mysql::Error)