Mysql::Error (Can't connect to MySQL server on )

got this error during production (production log) Mysql::Error (Can't connect to MySQL server on 'database server ip' (110)):

*** LOCAL GEMS ***

actionmailer (1.2.2)     Service layer for easy email delivery and testing.

actionpack (1.12.2)     Web-flow and rendering framework putting the VC in MVC.

actionwebservice (1.1.3)     Web service support for Action Pack.

activerecord (1.14.3)     Implements the ActiveRecord pattern for ORM.

activesupport (1.3.1)     Support and utility classes used by the Rails framework.

fcgi (0.8.7)     FastCGI library for Ruby.

mysql (2.7)     MySQL/Ruby provides the same functions for Ruby programs that the     MySQL C API provides for C programs.

rails (1.1.3)     Web-application framework with template engine, control-flow layer,     and ORM.

rake (0.8.7, 0.8.0)     Ruby based make-like utility.

rubyforge (1.0.4)     A script which automates a limited set of rubyforge operations

sources (0.0.1)     This package provides download sources for remote gem installation

Package installed

libdbi-dbd-mysql-0.6.5-10.RHEL4.1 MySQL-devel-standard-5.0.22-0.rhel4 perl-DBD-MySQL-2.9004-3.1 MySQL-shared-compat-5.0.22-0.rhel4 MySQL-python-1.2.1_p2-1.el4.1 php-mysql-4.3.9-3.9 qt-MySQL-3.3.3-9.3 MySQL-server-standard-5.0.22-0.rhel4 MySQL-client-standard-5.0.22-0.rhel4 mod_auth_mysql-2.6.1-2.2

Is your DB server accessible? Can you connect to it with the mysqlclient? Are you sure the DB config file has the correct parameters? Check if you're connecting via socket and specify it if necessary in the database.yml file. Also check if you're using "host" or "hostname" in the database.yml file.

Hope it helps.

I had mysql connection error on a production machine. The problem wascaused by incorrect location or missing mysql.sock file. Maybe you have the same issue.