Link to mysql.sock deleted at reboot


#1

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? :slight_smile:


#2

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 removed_email_address@domain.invalid


#3

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 removed_email_address@domain.invalid

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


#4

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


#5

On Nov 12, 4:05 am, Pål Bergström removed_email_address@domain.invalid
wrote:

Fred

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

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=7cfca6058e0cdd924e57df37ed1be5a7&p=4394679#post4394679

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

hth,

Craig


#6

Frederick C. 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 :slight_smile:

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.


#7

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? :slight_smile:

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)
} %>