How to change rails mysql socket PATH from /var/run to /var/

i have an app im installing that tries look for mysqld.sock in
/var/run/mysqld/mysqld.sock and mysql puts it at
/var/lib/mysql/mysql.sock.
if i point mysql at /var/run the app works i.e mysqld
-socket=/var/run/mysqld/mysqld.sock; if i don’t i get an error that goes
"
Showing app/views/articles/index.rhtml where line #35 raised:

No such file or directory - /var/run/mysqld/mysqld.sock". like i said i
can
get around this “manually” but i’d rather have them looking in the same
place by default. so, anyone know where i change that?

View this message in context:
http://www.nabble.com/how-to-change-rails-mysql-socket-PATH-from--var-run-to--var-lib--tf2042031.html#a5621414
Sent from the RubyOnRails Users forum at Nabble.com.

On 8/2/06, jz176 [email protected] wrote:

i have an app im installing that tries look for mysqld.sock in
/var/run/mysqld/mysqld.sock and mysql puts it at /var/lib/mysql/mysql.sock.
if i point mysql at /var/run the app works i.e mysqld
-socket=/var/run/mysqld/mysqld.sock; if i don’t i get an error that goes "
Showing app/views/articles/index.rhtml where line #35 raised:

No such file or directory - /var/run/mysqld/mysqld.sock". like i said i can
get around this “manually” but i’d rather have them looking in the same
place by default. so, anyone know where i change that?

In your database.yml file you can add something like this:

socket: <%= ["/tmp/mysqld.sock",
“/tmp/mysql.sock”,
“/var/run/mysqld/mysqld.sock”,
“/var/lib/mysql/mysql.sock”].detect{|socket|
File.exist?(socket)
} %>