Skip to content

Instantly share code, notes, and snippets.

@youngbrioche
Created January 5, 2010 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save youngbrioche/269318 to your computer and use it in GitHub Desktop.
Save youngbrioche/269318 to your computer and use it in GitHub Desktop.
# dynamically determining the MySQL socket in use
<% socket = ["/tmp/mysql.sock",
"/opt/local/var/run/mysql5/mysqld.sock",
"/tmp/mysqld.sock",
"/var/run/mysqld.sock"].detect { |socket| File.exist?(socket) } %>
development:
encoding: utf8
username: root
password:
database: iqvoc_development
<% if defined?(JRuby) %>
adapter: jdbcmysql
hostname: localhost
<% else %>
adapter: mysql
socket: <%= socket %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment