Technology Errors

‘Can’t connect to local MySQL server through socket’ in Rails 2.2.2

Error in Rails 2.2.2
Status: 500 Internal Server Error
Can’t connect to local MySQL server through socket ‘/opt/local/var/run/mysqld/mysqld.sock’ (2)

Add the socket location to database.yml

ruby

  1. production:
  2. adapter: mysql
  3. encoding: utf8
  4. database: example_production
  5. username: root
  6. password: passwordie
  7. pool: 5
  8. socket: '/var/lib/mysql/mysql.sock'
  9. host: 127.0.0.1

Reference: database.yml in Ruby on Rails