magento/devdocs — pull request #109 by Flyingmana (2014-12-22 15:46:38+00:00)
Title: use 127.0.0.1 instead of localhost for db host parameter

localhost means connect via socket, which is in some cases not available
or wrong configured or differs from the place php assumes it.

known Downsides: there may be performance impacts, but I never had something noticeable

Reason: It happens regularly that people have connection problems with localhost, which nearly always got resolved by changing to 127.0.0.1

PS: re submitted PR, as master was set previous