Mysql socket rails

software development

#1

I’m deploying my rails app through capistrano. But when i try to open the page i get (Rails application error)
err in logfiles : Cannot connect through mysql socket

I can connect to my db through mysql -u uname -ppassword -h mysql.mydomain.com

I changed my database.yml file to
production:
adapter: mysql
database: dbname
username: uname
password: pwd
host: mysql.mydomain.com
port: 3306

anyone any suggestions?