Skip to content

Instantly share code, notes, and snippets.

@take

take/database.yml

Created Jan 3, 2013
Embed
What would you like to do?
database.yml mysql adapter
<%
socket = ["/tmp/mysqld.sock",
"/tmp/mysql.sock",
"/var/run/mysqld/mysqld.sock",
"/var/lib/mysql/mysql.sock",
"/opt/local/var/run/mysql5/mysqld.sock"
].detect{|socket| File.exist?(socket)}
%>
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: db_development
pool: 5
username: root
password:
socket: <%= socket %>
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: mysql2
encoding: utf8
reconnect: false
database: db_test
pool: 5
username: root
password:
socket: <%= socket %>
production:
adapter: mysql2
encoding: utf8
reconnect: false
host:
database:
pool: 5
username:
password:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.