jz176
2006-Aug-02 20:37 UTC
[Rails] how to change rails mysql socket PATH from /var/run to /var/lib?
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.
Greg Donald
2006-Aug-02 20:46 UTC
[Rails] how to change rails mysql socket PATH from /var/run to /var/lib?
On 8/2/06, jz176 <zackjz@hotmail.com> 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) } %> -- Greg Donald http://destiney.com/
Possibly Parallel Threads
- Can't connect to local MySQL server through socket...
- Centos 6.6 Can't connect to local MySQL server through socket /var/lib/MySQL/MySQL.sock (error 2002)
- Centos 6.6 Can't connect to local MySQL server through socket /var/lib/MySQL/MySQL.sock (error 2002)
- MySQL stale socket
- Driving me nuts!!! - Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)