MySQLの「/tmp/mysql.sock」が見つからないというエラー

Railsの設定をしていって、アプリを立ち上げたらこんなエラーが。。

No such file or directory - /tmp/mysql.sock

こちらも調べてみると、いろいろと出ているようで、みなさん
解決方法をいろいろと書いてくれていました。

僕が参考にさせていただいたのは、「83's」さんの方法です。

僕の場合はこんな感じでした。

$ mysqladmin -p version
Enter password:
mysqladmin Ver 8.41 Distrib 5.0.27, for apple-darwin8.5.1 on i686
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version 5.0.27-standard-log
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /tmp/mysql.sock
Uptime: 10 min 56 sec

Threads: 1 Questions: 11 Slow queries: 0 Opens: 12 Flush tables: 1 Open tables: 6 Queries per second avg: 0.017

とうことで、「/tmp/mysql.sock」をconfig/database.ymlに設定してOKでした。

development:
adapter: mysql
database: test
username: test
password:
host: localhost
socket: /tmp/mysql.sock

どうしてこうなのか?ということ自体がまだわかっていないので
その辺をちゃんと理解できるようにしていかないとなぁ。。