Link to mysql.sock deleted at reboot

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:

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 [email protected]

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 [email protected]

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

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

On Nov 12, 4:05 am, Pål Bergström [email protected]
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.

hth,

Craig

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.

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