Sunday, 5 January 2014

Locating mysql sock file

Locating mysqld.sock file :

Its a simple step but may give you a hard time when you are a beginner.

Simply open : vim /etc/mysql/my.cnf

#Content of the file---

[client]
port            = 3306
socket          = /var/run/mysqld/mysqld.sock

here is the default port and default sock file

==========

I found the need for this file when i had to connect to mysql db from my rails app

to configure database.yml 

development:
    adapter: mysql
    encoding: utf8
    database: application
    username: appuser
    password: password
    socket: /var/run/mysqld/mysqld.sock

Hope you found what you were looking for
--Cheers