Monday June 23, 2008
TOTD #35: Rails Database Connection on Solaris
Are you deploying your JRuby-on-Rails applications
on Solaris
(or any variety of Unix) and not able to connect to the database ?
I experienced it last week so thought of sharing the tip here. Luckily
it's really simple.
Here is the default generated "config/database.yml"
| development: adapter: mysql encoding: utf8 database: runner_development username: root password: socket: /tmp/mysql.sock |
| development: adapter: mysql encoding: utf8 database: runner_development username: root password: socket: /tmp/mysql.sock host: 127.0.01 |
Please leave suggestions on other TOTD (Tip Of The Day) that you'd like to see. A complete archive is available here.
Technorati: totd rubyonrails jruby ruby opensolaris mysqlPosted by Arun Gupta in web2.0 | Comments[3]
|
|
|
|
|
Today's Page Hits: 763
Total # blog entries: 1007
| « December 2009 | ||||||
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
5 | ||||||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | ||
| Today | ||||||
Basically you don't need
'socket: /tmp/mysql.sock'
socket or host are mmutually exclusive, looks like if host entry is there it takes over socket.
Looks like there is some bug with handling unix domain socket, use -J-Djruby.native.enabled=false on the jruby CLI and you wont see any issue. See a thread on this atusers@jruby[1].
[1]http://markmail.org/search/list:org.codehaus.jruby?q=vivek+pandey#query:vivek%20pandey+page:1+mid:6d6rn6v2mlfrhzcs+state:results
Posted by vivek on June 23, 2008 at 09:54 AM PDT #
Posted by Arun Gupta's Blog on June 24, 2008 at 06:22 AM PDT #
One other step I needed was to add my port info. For instance:
development:
adapter: mysql
encoding: utf8
database: my_db_name_here
username: root
password: root
host: 127.0.0.1
port: 8889
Am running MySQL as part of the MAMP bundle; am guessing my port isn't the default.
Cheers,
Bobby
Posted by Bobby Bissett on August 21, 2008 at 11:41 AM PDT #