First, to find your socket file:
mysqladmin variables | grep socket
For me, this gives:
| socket | /tmp/mysql.sock |
Then, add a line to your config/database.yml
:
development:
adapter: mysql2
host: localhost
username: root
password: xxxx
database: xxxx
socket: /tmp/mysql.sock