May 7, 2008

database.yml, mysql and ubuntu

If you don't want to specify 'socket' entry in rails database.yml simply create link for it:


sudo ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock

Now you database.yml may look like this:

defaults: &defaults
adapter: mysql
encoding: utf8
username: user
password: secret
host: localhost

development:
database: somedb
<<: *defaults

test:
database: somedb_test
<<: *defaults

production:
database: somedb_production
<<: *defaults

0 comments: