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
- production:
- adapter: mysql
- encoding: utf8
- database: example_production
- username: root
- password: passwordie
- pool: 5
- socket: '/var/lib/mysql/mysql.sock'
- host: 127.0.0.1
Reference: database.yml in Ruby on Rails
Another reason you might see this error is if MySQL is not started.
You can start it with this command on Leopard Mac OS X
/usr/local/mysql/bin/mysqld_safe
Or this site shows how to auto-start MySQL every time you start or reboot your Mac
http://hivelogic.com/articles/installing-mysql-on-mac-os-x/