Forum: Ruby on Rails Link to mysql.sock deleted at reboot

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3275da7fdbd73cb4e7956fd0d29164de?d=identicon&s=25 Paul Bergstrom (palb)
on 2008-11-12 08:16
I'm on Mac OS 10.5. How do I get a link from /tmp/mysql.sock  to
/opt/.../mysql.sock to stay after reboot?

Is there a better way of doing this, like adding an alias in .profile if
possible, or is it assumed that you never reboot your machine? :-)
29ebf90af6107d2eb39b587c7972639c?d=identicon&s=25 Mukund (Guest)
on 2008-11-12 10:23
(Received via mailing list)
Why don't you use the socket option in database.yml to point to
opt/...  ?   You can use this setting for development and another for
production.  Alternatively create database.mymachine.yml and
database.production.yml and link the right file to database.yml



On Nov 12, 12:16 pm, Pål Bergström <rails-mailing-l...@andreas-s.net>
3275da7fdbd73cb4e7956fd0d29164de?d=identicon&s=25 Paul Bergstrom (palb)
on 2008-11-12 10:32
Mukund wrote:
> Why don't you use the socket option in database.yml to point to
> opt/...  ?   You can use this setting for development and another for
> production.  Alternatively create database.mymachine.yml and
> database.production.yml and link the right file to database.yml
>
>
>
> On Nov 12, 12:16�pm, P�l Bergstr�m <rails-mailing-l...@andreas-s.net>

I could do that, but it's convenient to use /tmp/mysql.sock as other
programs look there first.
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2008-11-12 11:48
(Received via mailing list)
On 12 Nov 2008, at 09:32, Pål Bergström wrote:

>> s.net>
>
> I could do that, but it's convenient to use /tmp/mysql.sock as other
> programs look there first.

Presumably you can configure mysql to put its socket in /tmp rather
than in /opt/...

Fred
3275da7fdbd73cb4e7956fd0d29164de?d=identicon&s=25 Paul Bergstrom (palb)
on 2008-11-12 12:05
Frederick Cheung wrote:
> On 12 Nov 2008, at 09:32, Pål Bergström wrote:
>
>>> s.net>
>>
>> I could do that, but it's convenient to use /tmp/mysql.sock as other
>> programs look there first.
>
> Presumably you can configure mysql to put its socket in /tmp rather
> than in /opt/...
>
> Fred

True. But not sure my skills are up to that. Yet another thing to figure
out :-)

I think I'll try to make a applecsript/shell script that runs at
startup. I've done something similar before.

Thanks for the help.
Dbe27b7f67502e08750a03c1796d5139?d=identicon&s=25 Craig (Guest)
on 2008-11-12 15:36
(Received via mailing list)
On Nov 12, 4:05 am, Pål Bergström <rails-mailing-l...@andreas-s.net>
wrote:
>
> > Fred
>
> True. But not sure my skills are up to that. Yet another thing to figure
> out :-)
>
> I think I'll try to make a applecsript/shell script that runs at
> startup. I've done something similar before.
>
> Thanks for the help.



Here are a couple of articles I used to help me get Rails & MySql
running on Leopard.

http://forums.macrumors.com/showthread.php?s=7cfca...

http://hivelogic.com/articles/2008/02/ruby-rails-leopard

hth,

Craig
46f52c33235283752423837b91c581dd?d=identicon&s=25 Norm (Guest)
on 2008-11-12 21:08
(Received via mailing list)
Pål Bergström wrote:
> I'm on Mac OS 10.5. How do I get a link from /tmp/mysql.sock  to
> /opt/.../mysql.sock to stay after reboot?
>
> Is there a better way of doing this, like adding an alias in .profile if
> possible, or is it assumed that you never reboot your machine? :-)
>
This might do what you want with the values you want in it:

#   recipe 25 from "rails recipes"
#
# dynamicly configure the database
#
  socket: <%= ["/tmp/mysqld.sock",
               "/tmp/msql.sock",
               "/var/run/mysqld/mysqld.sock",
               "/var/run/mysqld/mysql.sock"].detect{|socket|
                 File.exist?(socket)
               } %>
This topic is locked and can not be replied to.